To access the Simplest Possible REST Endpoint from Java, you will have to implement some code:
import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; final String URI = "http://localhost:8080/hello-rest/resources/message"; //... Client client = ClientBuilder.newClient(); String result = client.target(URI). request(). get(String.class); assertThat(result, containsString("duke"));
For server-to-server communication no additional dependency is required. If you are using the client as test driver, you will have to declare the dependency to the SPI of you choice e.g.
<dependency> <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-client</artifactId> <version>2.21</version> </dependency>
On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming.