Skip to content

Commit ba58765

Browse files
authored
Use Hamcrest assertions instead of JUnit in webserver/jersey (helidon-io#1749) (helidon-io#5113)
1 parent 764ed9f commit ba58765

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

webserver/jersey/src/test/java/io/helidon/webserver/jersey/JerseyExampleResource.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
import jakarta.ws.rs.core.StreamingOutput;
4242
import jakarta.ws.rs.core.UriInfo;
4343

44-
import static org.junit.jupiter.api.Assertions.assertEquals;
44+
import static org.hamcrest.CoreMatchers.is;
45+
import static org.hamcrest.MatcherAssert.assertThat;
4546

4647
/**
4748
* The JerseyExampleResource.
@@ -149,7 +150,7 @@ public Response checkSequenceStream(InputStream inputStream, @QueryParam("length
149150
String content = new String(inputStream.readAllBytes());
150151

151152
try {
152-
assertEquals(JerseySupportTest.longData(length).toString(), content);
153+
assertThat(content, is(JerseySupportTest.longData(length).toString()));
153154
} catch (Throwable e) {
154155
streamException = e;
155156
throw new IllegalStateException("NOT EQUALS");

webserver/jersey/src/test/java/io/helidon/webserver/jersey/JerseySupportTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import static org.hamcrest.MatcherAssert.assertThat;
4343
import static org.hamcrest.Matchers.contains;
4444
import static org.hamcrest.Matchers.is;
45-
import static org.junit.jupiter.api.Assertions.assertNotNull;
4645

4746
/**
4847
* The JerseySupportTest.
@@ -222,7 +221,7 @@ public void longPostNotFound() {
222221
// in this case the test is a no-op.
223222
return;
224223
}
225-
assertNotNull(response);
224+
assertThat(response, notNullValue());
226225
doAssert(response, null, Response.Status.NOT_FOUND);
227226
}
228227

0 commit comments

Comments
 (0)