use of com.baeldung.client.ServicesInterface in project tutorials by eugenp.
the class RestEasyClientLiveTest method testUpdateMovie.
@Test
public void testUpdateMovie() {
final ResteasyClient client = new ResteasyClientBuilder().build();
final ResteasyWebTarget target = client.target(FULL_PATH);
final ServicesInterface proxy = target.proxy(ServicesInterface.class);
Response moviesResponse = proxy.addMovie(batmanMovie);
moviesResponse.close();
batmanMovie.setTitle("Batman Begins");
moviesResponse = proxy.updateMovie(batmanMovie);
if (moviesResponse.getStatus() != Response.Status.OK.getStatusCode()) {
System.out.println("Failed : HTTP error code : " + moviesResponse.getStatus());
}
moviesResponse.close();
System.out.println("Response Code: " + moviesResponse.getStatus());
}
Aggregations