Skip to content

Commit

Permalink
Close SseEventSink at the end of the example
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Supol <[email protected]>
  • Loading branch information
jansupol committed Dec 6, 2019
1 parent 8dcfed4 commit 922570b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,13 @@ public void testEventSource() throws Exception {
});

eventSource.open();
target().path(App.ROOT_PATH).request().post(Entity.text("message"));
target().path(App.ROOT_PATH).request().post(Entity.text("message")).close();

try {
assertTrue("Waiting for message to be delivered has timed out.",
latch.await(5 * getAsyncTimeoutMultiplier(), TimeUnit.SECONDS));
} finally {
target().path(App.ROOT_PATH).request().delete().close();
eventSource.close();
}
assertThat("Unexpected SSE event data value.", message.get(), equalTo("message"));
Expand Down

0 comments on commit 922570b

Please sign in to comment.