}
protected void checkValuesInserted(GeoServerUserGroupService userGroupService) throws IOException {
assertEquals(5, userGroupService.getUsers().size());
assertEquals(5, userGroupService.getUserCount());
GeoServerUser admin = (GeoServerUser) userGroupService.getUserByUsername(GeoServerUser.ADMIN_USERNAME);
GeoServerUser user1 = (GeoServerUser) userGroupService.getUserByUsername("user1");
GeoServerUser user2 = (GeoServerUser) userGroupService.getUserByUsername("user2");
GeoServerUser disableduser = (GeoServerUser) userGroupService.getUserByUsername("disableduser");
GeoServerUser groupAdminUser = (GeoServerUser) userGroupService.getUserByUsername("groupAdminUser");
assertNull(userGroupService.getUserByUsername("xxx"));
assertTrue(userGroupService.getUsers().contains(admin));
assertTrue(userGroupService.getUsers().contains(user1));
assertTrue(userGroupService.getUsers().contains(user2));
assertTrue(userGroupService.getUsers().contains(disableduser));
assertTrue(userGroupService.getUsers().contains(groupAdminUser));
// check if properties are loaded too
for (GeoServerUser user : userGroupService.getUsers() ) {
if (user2.getUsername().equals(user.getUsername())) {
assertEquals(2,user.getProperties().size());
assertEquals(user.getProperties().getProperty("mail"),"user2@gmx.com");
assertEquals(user.getProperties().getProperty("tel"),"12-34-38");
} else {
assertEquals(0,user.getProperties().size());
}
}
assertTrue(admin.isEnabled());
assertTrue(user1.isEnabled());
assertTrue(user2.isEnabled());
assertFalse(disableduser.isEnabled());
assertTrue(groupAdminUser.isEnabled());
/*assertFalse(user1.isGroupAdmin());
assertFalse(user2.isGroupAdmin());
assertTrue(groupAdminUser.isGroupAdmin());*/