40414243444546
return new User("testuser", "testuser", hotmail()); } @Bean(name = "dao.contactCreator") public ContactCreator contactCreator() { return new ContactCreator(); }
22232425262728
private ContactRepository contactRepository; @BeforeClass public void setUp() { sessionFactory = new Configuration().configure().buildSessionFactory(); contactRepository = new HibernateContactRepository(new ContactCreator(), sessionFactory); }
25262728293031
sessionFactory.close(); } @Override protected ContactRepository createContactRepository() { return new HibernateContactRepository(new ContactCreator(), sessionFactory); }
10111213141516
public class InMemoryEmailRepositoryTest extends BaseEmailRepositoryTest { @Override protected EmailRepository createEmailRepository() { return new InMemoryEmailRepository(new InMemoryContactRepository(new ContactCreator())); }
12131415161718
public class InMemoryContactRepositoryTest extends BaseContactRepositoryTest { @Override protected ContactRepository createContactRepository() { return new InMemoryContactRepository(new ContactCreator()); }