Issue #3422 - Fixing testcase expectations

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2019-03-15 14:08:33 -05:00
parent 4fb1940283
commit d7364e4794
2 changed files with 3 additions and 9 deletions

View File

@ -38,7 +38,6 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
public class CloseTrackingEndpoint extends WebSocketAdapter
{
@ -66,11 +65,7 @@ public class CloseTrackingEndpoint extends WebSocketAdapter
assertThat("Client Close Event Occurred", closeLatch.await(clientTimeoutMs, TimeUnit.MILLISECONDS), is(true));
assertThat("Client Close Event Count", closeCount.get(), is(1));
assertThat("Client Close Event Status Code", closeCode, statusCodeMatcher);
if (reasonMatcher == null)
{
assertThat("Client Close Event Reason", closeReason, nullValue());
}
else
if (reasonMatcher != null)
{
assertThat("Client Close Event Reason", closeReason, reasonMatcher);
}

View File

@ -249,9 +249,8 @@ public class ClientCloseTest
// client reads -1 (EOF)
// client triggers close event on client ws-endpoint
clientSocket.assertReceivedCloseEvent(clientTimeout * 2,
is(StatusCode.SHUTDOWN),
containsString("timeout"));
// assert - close code==1006 (abnormal) or code==1001 (shutdown)
clientSocket.assertReceivedCloseEvent(clientTimeout * 2, anyOf(is(StatusCode.SHUTDOWN), is(StatusCode.ABNORMAL)));
}
clientSessionTracker.assertClosedProperly(client);