@Test
public void testCdiRepository() {
assertNotNull(repository);
User bean = new User();
bean.setUsername("username");
bean.setFirstName("first");
bean.setLastName("last");
repository.save(bean);
assertTrue(repository.exists(bean.getUsername()));
User retrieved = repository.findOne(bean.getUsername());
assertNotNull(retrieved);
assertEquals(bean.getUsername(), retrieved.getUsername());
assertEquals(bean.getFirstName(), retrieved.getFirstName());
assertEquals(bean.getLastName(), retrieved.getLastName());
assertEquals(1, repository.count());
assertTrue(repository.exists(bean.getUsername()));