@Test public void shouldGetAllCustomers() { CustomerDto customer = new CustomerDto("1", "Melody", "Yates"); List<CustomerDto> customers = new ArrayList<>(); customers.add(customer); CustomerResource customerResource = new CustomerResource(customers); List<CustomerDto> allCustomers = customerResource.getAllCustomers(); assertEquals(allCustomers.size(), 1); assertEquals(allCustomers.get(0).getId(), "1"); assertEquals(allCustomers.get(0).getFirstName(), "Melody"); assertEquals(allCustomers.get(0).getLastName(), "Yates"); }
public List<CustomerDto> getAllCustomers() { return customers; }
CustomerResource { public List<CustomerDto> getAllCustomers() { return customers; } }
CustomerResource { public List<CustomerDto> getAllCustomers() { return customers; } CustomerResource(List<CustomerDto> customers); }
CustomerResource { public List<CustomerDto> getAllCustomers() { return customers; } CustomerResource(List<CustomerDto> customers); List<CustomerDto> getAllCustomers(); void save(CustomerDto customer); void delete(String customerId); }
CustomerResource { public List<CustomerDto> getAllCustomers() { return customers; } CustomerResource(List<CustomerDto> customers); List<CustomerDto> getAllCustomers(); void save(CustomerDto customer); void delete(String customerId);  }