@Test public void testSave() { User user = UserBuilder.userBuilder(1) .username("test") .email("*****@*****.**") .password("test") .build(); user = userManager.get(userManager.save(user, true)); Assert.assertNotNull(user); Assert.assertNotNull(user.getUsername()); Assert.assertEquals(new Integer(0), user.getUserLoginStatistic().getLoginOk()); Assert.assertNotNull(user.getRoles()); Assert.assertTrue(user.getRoles().size() > 0); }
@Test public void testGetAll() { List<User> users = userManager.all(); Assert.assertTrue(users.size() > 0); for (User user : users) { Assert.assertTrue(user.getRoles().size() > 0); } }