From 916b8fd13b19f3ce7ed0f7dda1eea2b8892b0cb3 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 5 May 2019 12:24:58 +0300 Subject: Fix /ws/ redirects --- src/test/java/com/juick/server/tests/ServerTests.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/test/java/com/juick/server') diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index c554f20e..322d4de7 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -2048,4 +2048,17 @@ public class ServerTests { .andExpect(status().isOk()) .andExpect(content().contentType("application/rss+xml;charset=UTF-8")); } + + @Test + public void wsThreadsShouldRedirect() throws Exception { + int mid = messagesService.createMessage(ugnich.getUid(), "tst", null, Collections.emptyList()); + mockMvc.perform(get("/ugnich/" + mid)) + .andExpect(status().isOk()); + mockMvc.perform(get("/s/" + mid)) + .andExpect(status().isFound()) + .andExpect(redirectedUrl("/ugnich/" + mid)); + mockMvc.perform(get("/ws/" + mid)) + .andExpect(status().isFound()) + .andExpect(redirectedUrl("/ugnich/" + mid)); + } } -- cgit v1.2.3