Skip to content

Commit

Permalink
Use Hamcrest assertions instead of JUnit in examples/webserver/jersey (
Browse files Browse the repository at this point in the history
  • Loading branch information
Captain1653 authored Oct 11, 2022
1 parent 19a7cf3 commit a5a78ea
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2021 Oracle and/or its affiliates.
* Copyright (c) 2017, 2022 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,7 +27,8 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

/**
* The Jersey Client based example that tests the {@link HelloWorld} resource
Expand Down Expand Up @@ -63,8 +64,8 @@ public void testHelloWorld() throws Exception {
.path("jersey/hello")
.request()
.get()) {
assertEquals("Hello World!", response.readEntity(String.class),
"Unexpected response; status: " + response.getStatus());
assertThat("Unexpected response; status: " + response.getStatus(),
response.readEntity(String.class), is("Hello World!"));
} finally {
client.close();
}
Expand Down

0 comments on commit a5a78ea

Please sign in to comment.