Assert.assertNotNull(repository);
}
@Test
public void testCRUDOperations() throws InterruptedException {
ProductBean initial = createProductBean("1");
ProductBeanRepository repository = factory.getRepository(ProductBeanRepository.class);
Assert.assertEquals(0, repository.count());
repository.save(initial);
Assert.assertEquals(1, repository.count());
ProductBean loaded = repository.findOne(initial.getId());
Assert.assertEquals(initial.getName(), loaded.getName());
loaded.setName("name changed");
repository.save(loaded);
Assert.assertEquals(1, repository.count());
loaded = repository.findOne(initial.getId());
Assert.assertEquals("name changed", loaded.getName());
repository.delete(loaded);
Thread.sleep(100);
Assert.assertEquals(0, repository.count());