Skip to content

Commit

Permalink
fixed ManyUsersTest
Browse files Browse the repository at this point in the history
  • Loading branch information
tkyjovsk committed Dec 21, 2016
1 parent 2ba2148 commit 1c65fd8
Showing 1 changed file with 8 additions and 5 deletions.
Expand Up @@ -98,7 +98,7 @@ public void before() {
if (CREATE_OBJECTS) {

// Assuming default groups and required action already created
if (realmResource().getDefaultGroups().size() == 0) {
if (realmResource().getDefaultGroups().isEmpty()) {
log.infof("Creating default groups 'group1' and 'group2'.");
setDefaultGroup("group1");
setDefaultGroup("group2");
Expand All @@ -121,20 +121,17 @@ private void setDefaultGroup(String groupName) {
realmResource().addDefaultGroup(groupId);
}



@After
public void after() {
realmTimer.clearStats(true, true, false);
usersTimer.clearStats();
}


@Override
public UserRepresentation createUser(UsersResource users, UserRepresentation user) {
// Add some additional attributes to user
if (CREATE_OBJECTS) {
Map<String, Object> attrs = new HashMap<>();
Map<String, List<String>> attrs = new HashMap<>();
attrs.put("attr1", Collections.singletonList("val1"));
attrs.put("attr2", Collections.singletonList("val2"));
user.setAttributes(attrs);
Expand Down Expand Up @@ -247,4 +244,10 @@ public void manyUsers() throws IOException {
realmTimer.reset();
}

private void createRealm(String REALM) {
RealmRepresentation rep = new RealmRepresentation();
rep.setRealm(REALM);
adminClient.realms().create(rep);
}

}

0 comments on commit 1c65fd8

Please sign in to comment.