Skip to content

Instantly share code, notes, and snippets.

@GSala
Last active November 26, 2015 17:13
Show Gist options
  • Save GSala/d2adbd76ea91b6c22fc8 to your computer and use it in GitHub Desktop.
Save GSala/d2adbd76ea91b6c22fc8 to your computer and use it in GitHub Desktop.
private static final Client client = ClientBuilder.newClient();
private static final WebTarget r = client.target("http://localhost:8080/tg/api/itineraries");
@Test
public void testAddHotel(){
HotelType hotel = new HotelType();
hotel.setName("Palacio");
HotelType response = r.path("1/hotels")
.request()
.accept(MediaType.APPLICATION_XML)
.post(Entity.entity(hotel, MediaType.APPLICATION_XML),
HotelType.class);
assertEquals(hotel.getName(), response.getName());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment