public void testList() {
int count_addresses = 4;
// first, save a new Customer
Customer customer = CustomerRemoteServiceTest.generateCustomer();
try {
customerService.save(customer);
} catch (ServiceException e) {
fail(e.getMessage());
}
for (int i = 0; i < count_addresses; i++) {
CustomerAddress address = generateAddress();
address.setCustomer(customer);
try {
service.save(address);
} catch (ServiceException e) {
fail(e.getMessage());
}
}
try {
List<CustomerAddress> results = service.list(customer.getId());
for (CustomerAddress customerAddress : results)
System.out.println(customerAddress.toString());
assertEquals(results.size(), count_addresses);