}
@Test
public void testClientSetup() {
Client pojo = factory.manufacturePojo(Client.class);
Assert.assertNotNull("The pojo cannot be null!", pojo);
Assert.assertNotNull("The client's first name cannot be null!",
pojo.getFirstName());
Assert.assertTrue("The client's first name cannot be empty!", pojo
.getFirstName().length() > 0);
String expectedFirstName = "Michael";
Assert.assertEquals("The client's first name is not "
+ expectedFirstName, expectedFirstName, pojo.getFirstName());
Assert.assertNotNull("The client's last name cannot be null!",
pojo.getLastName());
Assert.assertTrue("The client's last name cannot be empty!", pojo
.getLastName().length() > 0);
Assert.assertNotNull("The date created cannot be null!",
pojo.getDateCreated());
List<Order> orders = pojo.getOrders();
Assert.assertNotNull("The orders cannot be null!", orders);
int expectedOrdersNbr = 3;
Assert.assertTrue("The expected number of orders is "
+ expectedOrdersNbr, orders.size() == expectedOrdersNbr);
for (Order order : orders) {
validateOrder(order);
}
List<Address> addresses = pojo.getAddresses();
Assert.assertNotNull("The addresses cannot be null!", addresses);
int expectedAddressesNbr = 2;
Assert.assertTrue("The expected number of addresses is "
+ expectedAddressesNbr,
addresses.size() == expectedAddressesNbr);
for (Address address : addresses) {
validateAddress(address);
}
List<BankAccount> bankAccounts = pojo.getBankAccounts();
Assert.assertNotNull("The bank accounts cannot be null!", bankAccounts);
Assert.assertEquals("Unexpected number of addresses",
strategy.getNumberOfCollectionElements(BankAccount.class),
bankAccounts.size());