Role[] currentRoles = getDefaultUserDatabase().listAllRoles(UserDatabase.WILDCARD_SEARCH, Integer.MAX_VALUE);
int currentNumberOfRoles = currentRoles.length;
assertEquals("There should only be the 1 role 'Users'.", getDefaultUserDatabase().listAllRoles(
UserDatabase.WILDCARD_SEARCH, Integer.MAX_VALUE).length, 1);
// create 6 roles
Role role1 = createRole("aaaa");
Role role2 = createRole("abbb");
Role role3 = createRole("aabb");
Role role4 = createRole("aaab");
Role role5 = createRole("bbbb");
Role role6 = createRole("xaax");
assertEquals("There should be the seven roles.", getDefaultUserDatabase().listAllRoles(UserDatabase.WILDCARD_SEARCH,
Integer.MAX_VALUE).length, currentNumberOfRoles + 6);
assertEquals("There should be the five roles.", getDefaultUserDatabase().listAllRoles("a*", Integer.MAX_VALUE).length, 4);
assertEquals("There should be the three roles.", getDefaultUserDatabase().listAllRoles("aa*", Integer.MAX_VALUE).length, 3);
assertEquals("There should be the two roles.", getDefaultUserDatabase().listAllRoles("aaa*", Integer.MAX_VALUE).length, 2);