@Test public void testCreateCustomer() { Customer customer = new Customer(); FullName fullName = new FullName(); fullName.setFirstName("test"); fullName.setMiddleName("test"); fullName.setSurName("test"); customer.setFullName(fullName); customer.setCreditRating(80); customer.setInitials("S"); customer.setMaritalStatus(MaritalStatus.valueOf("MARRIED")); customer.setNabCustomer(true); Address address = new Address(); address.setStreetNumber(12); address.setStreetName("test"); address.setSuburb("test"); address.setCity("test"); address.setState("test"); address.setPincode(3166); address.setCountry("test"); customer.setResidenceAddress(address); customer.setSex(Sex.valueOf("MALE")); customer.setTitle("Mr"); assert (customerService.createCustomer(customer)); }
@Test public void testUpdateCustomer() { Customer customer = customerService.getCustomer(getMaxCustomerId()); customer.getFullName().setFirstName("test1"); assert (customerService.updateCustomer(customer)); }
@Test public void testGetCustomer() { Customer customer = customerService.getCustomer(getMaxCustomerId()); assertEquals(customer.getFullName().getSurName(), "test"); }