@Test public void testCreateContact() { String firstname = "John", lastname = "Doe"; Contact johnDoe = contactService.createContact(firstname, lastname); assertNotNull(johnDoe); assertNotNull(johnDoe.getId()); }
public Contact createContact(String firstname, String lastname) { Contact contact = new Contact(); contact.setFirstname(firstname); contact.setLastname(lastname); contactDao.createContact(contact); return contact; }
ContactServiceImpl implements ContactService { public Contact createContact(String firstname, String lastname) { Contact contact = new Contact(); contact.setFirstname(firstname); contact.setLastname(lastname); contactDao.createContact(contact); return contact; } }
ContactServiceImpl implements ContactService { public Contact createContact(String firstname, String lastname) { Contact contact = new Contact(); contact.setFirstname(firstname); contact.setLastname(lastname); contactDao.createContact(contact); return contact; } ContactServiceImpl(ContactDao contactDao); }
ContactServiceImpl implements ContactService { public Contact createContact(String firstname, String lastname) { Contact contact = new Contact(); contact.setFirstname(firstname); contact.setLastname(lastname); contactDao.createContact(contact); return contact; } ContactServiceImpl(ContactDao contactDao); Contact createContact(String firstname, String lastname); Collection<Contact> searchContactByName(String firstname); }
ContactServiceImpl implements ContactService { public Contact createContact(String firstname, String lastname) { Contact contact = new Contact(); contact.setFirstname(firstname); contact.setLastname(lastname); contactDao.createContact(contact); return contact; } ContactServiceImpl(ContactDao contactDao); Contact createContact(String firstname, String lastname); Collection<Contact> searchContactByName(String firstname);  }