ChatServletTest fix test
This commit is contained in:
parent
df17ef8b3a
commit
391b0ee426
|
@ -1,2 +1,2 @@
|
||||||
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
|
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
|
||||||
com.acme.LEVEL=DEBUG
|
com.acme.LEVEL=INFO
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class ChatServletTest
|
||||||
tester.setContextPath("/");
|
tester.setContextPath("/");
|
||||||
|
|
||||||
ServletHolder dispatch = tester.addServlet(ChatServlet.class, "/chat/*");
|
ServletHolder dispatch = tester.addServlet(ChatServlet.class, "/chat/*");
|
||||||
dispatch.setInitParameter("asyncTimeout","500");
|
dispatch.setInitParameter("asyncTimeout", "500");
|
||||||
tester.start();
|
tester.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,8 +61,9 @@ public class ChatServletTest
|
||||||
@Test
|
@Test
|
||||||
public void testChat() throws Exception
|
public void testChat() throws Exception
|
||||||
{
|
{
|
||||||
assertResponse("user=test&message=has%20joined!", "{\"from\":\"test\",\"chat\":\"has joined!\"}");
|
assertResponse("user=test&join=true&message=has%20joined!", "{\"from\":\"test\",\"chat\":\"has joined!\"}");
|
||||||
assertResponse("user=test&message=message", "");
|
String response = tester.getResponses(createRequestString("user=test&message=message"));
|
||||||
|
assertThat(response.contains("{"), is(false)); // make sure we didn't get a json body
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue