Package uk.co.jemos.podam.test.dto.docs.example

Examples of uk.co.jemos.podam.test.dto.docs.example.Client


  }

  @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());
View Full Code Here

TOP

Related Classes of uk.co.jemos.podam.test.dto.docs.example.Client

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.