From 0cb00c61bd1ab203c66878d3c313b6f40b4cc707 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 4 Oct 2018 19:33:03 +0300 Subject: fix some tests, disable Note endpoint until negotiation fixed --- .../src/test/java/com/juick/server/tests/ServerTests.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'juick-server/src/test') diff --git a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java index 386b989a..3c59fde0 100644 --- a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java +++ b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java @@ -1692,7 +1692,7 @@ public class ServerTests { @Test public void signingSpec() throws IOException { Key fromKey = new Key(); - fromKey.setId("to-key-id"); + fromKey.setId("http://localhost:8080/u/freefd#main-key"); Person from = new Person(); from.setPublicKey(fromKey); Person to = new Person(); @@ -1708,4 +1708,15 @@ public class ServerTests { .andExpect(status().isOk()).andReturn(); String xrd = result.getResponse().getContentAsString(); } + @Test + public void contentNegotiationTest() throws Exception { + int mid = messagesService.createMessage(ugnich.getUid(),"TXT", null, Collections.emptyList()); + mockMvc.perform(get("/m/" + mid) + .header("Accept", "text/html")).andExpect(status().is3xxRedirection()); + mockMvc.perform(get("/m/" + mid) + .header("Accept", "application/activity+json")).andExpect(status().isOk()); + mockMvc.perform(get("/m/" + mid) + .header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")) + .andExpect(status().is3xxRedirection()); + } } -- cgit v1.2.3