From d3b22e5559781f0c7d575725d37df0ad9302e54f Mon Sep 17 00:00:00 2001 From: Nicolas Colomer Date: Sun, 23 Sep 2012 20:54:29 +0200 Subject: [PATCH] Fix #11 - event posting can now be synchronized --- .../java/org/mappush/resource/EventResourceITest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/mappush/resource/EventResourceITest.java b/src/test/java/org/mappush/resource/EventResourceITest.java index b50f95a..8182d29 100644 --- a/src/test/java/org/mappush/resource/EventResourceITest.java +++ b/src/test/java/org/mappush/resource/EventResourceITest.java @@ -50,8 +50,7 @@ public void postEvent_withInvalidData() throws Exception { public void postEvent_withAsyncDisabled() throws Exception { // setup final String event = "{\"lat\":1.234,\"lng\":1.234}"; - WebSocket webSocket1 = getWebSocket(); - WebSocket webSocket2 = getWebSocket(); + WebSocket webSocket = getWebSocket(); // test Response response = client.preparePost(buildHttpUrl("event")) .addQueryParameter("async", "false") @@ -59,9 +58,8 @@ public void postEvent_withAsyncDisabled() throws Exception { .setBody(event).execute().get(); // assert assertEquals(response.getStatusCode(), 200); - assertEquals(response.getResponseBody(), "2"); - webSocket1.close(); - webSocket2.close(); + assertEquals(response.getResponseBody(), "1"); + webSocket.close(); } @Test