Skip to content

Commit

Permalink
Fix #11 - event posting can now be synchronized
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Colomer committed Sep 23, 2012
1 parent 898825f commit d3b22e5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/test/java/org/mappush/resource/EventResourceITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,16 @@ 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")
.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.setBody(event).execute().get();
// assert
assertEquals(response.getStatusCode(), 200);
assertEquals(response.getResponseBody(), "2");
webSocket1.close();
webSocket2.close();
assertEquals(response.getResponseBody(), "1");
webSocket.close();
}

@Test
Expand Down

0 comments on commit d3b22e5

Please sign in to comment.