Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.

Commit 0720b6d

Browse files
author
Dan Downs
committed
update unit test
1 parent 663a6d2 commit 0720b6d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/client/ResponseCloseTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
import org.glassfish.jersey.test.JerseyTest;
5050

5151
import org.junit.Test;
52+
53+
import static org.junit.Assert.assertFalse;
5254
import static org.junit.Assert.fail;
5355

5456
/**
@@ -160,10 +162,10 @@ public void testHasEntityAfterClose() {
160162
final Response response = target().path("simple").request().get(Response.class);
161163
response.close();
162164
try {
163-
response.hasEntity();
164-
fail("IllegalStateException expected when reading a buffered entity after response has been closed.");
165+
boolean hasEntity = response.hasEntity();
166+
assertFalse("Should return false when the connection is already closed", hasEntity);
165167
} catch (IllegalStateException ex) {
166-
// expected
168+
fail("IllegalStateException should have been caught inside hasEntity.");
167169
}
168170
}
169171
}

0 commit comments

Comments
 (0)