use of org.glassfish.jersey.examples.xmlmoxy.beans.Customer in project jersey by jersey.
the class MoxyAppTest method testCustomer.
/**
* Test that the expected response is sent back.
* @throws java.lang.Exception
*/
@Test
public void testCustomer() throws Exception {
final WebTarget webTarget = target().path("customer");
Customer customer = webTarget.request(MediaType.APPLICATION_XML).get(Customer.class);
customer.setName("Tom Dooley");
webTarget.request(MediaType.APPLICATION_XML).put(Entity.entity(customer, MediaType.APPLICATION_XML));
Customer updatedCustomer = webTarget.request(MediaType.APPLICATION_XML).get(Customer.class);
assertEquals(customer, updatedCustomer);
}
use of org.glassfish.jersey.examples.xmlmoxy.beans.Customer in project jersey by jersey.
the class CustomerResource method createInitialCustomer.
private static Customer createInitialCustomer() {
final Customer result = new Customer();
result.setName("Jane Doe");
result.setAddress(new Address("123 Any Street", "My Town"));
result.getPhoneNumbers().add(new PhoneNumber("work", "613-555-1111"));
result.getPhoneNumbers().add(new PhoneNumber("cell", "613-555-2222"));
return result;
}
Aggregations