Skip to content

Commit

Permalink
Add forgotten files
Browse files Browse the repository at this point in the history
This adapts the rest of security tests.
  • Loading branch information
mederly committed Mar 2, 2021
1 parent d0f68d5 commit 26ee188
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Expand Up @@ -504,6 +504,10 @@ protected int getNumberOfRoles() {
return super.getNumberOfRoles() + NUMBER_OF_IMPORTED_ROLES;
}

protected int getNumberOfTasks() {
return 2;
}

@Test
public void test010SanitySelf() throws Exception {
assertLoggedInUsername(USER_ADMINISTRATOR_USERNAME);
Expand Down Expand Up @@ -558,10 +562,10 @@ protected void assertSuperuserAccess(int readUserNum) throws Exception {
assertModifyAllow();
assertDeleteAllow();

assertSearch(AccessCertificationCampaignType.class, null, 2); // 2 campaigns there
assertSearch(AccessCertificationCampaignType.class, null, 2); // 2 campaigns there
assertReadCertCasesAllow();
assertReadCasesAllow();
assertSearch(TaskType.class, null, 2);
assertSearch(TaskType.class, null, getNumberOfTasks());

assertAssignableRoleSpecification(getUser(USER_JACK_OID))
.relationDefault()
Expand Down
Expand Up @@ -153,12 +153,17 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti
repoAdd(TASK_DUMMY, initResult);
}

protected static final int NUMBER_OF_IMPORTED_ROLES = 20;
private static final int NUMBER_OF_IMPORTED_ROLES = 20;
private static final int NUMBER_OF_IMPORTED_TASKS = 1;

protected int getNumberOfRoles() {
return super.getNumberOfRoles() + NUMBER_OF_IMPORTED_ROLES;
}

protected int getNumberOfTasks() {
return super.getNumberOfTasks() + NUMBER_OF_IMPORTED_TASKS;
}

/**
* Stay logged in as administrator. Make sure that our assumptions about
* the users and roles are correct.
Expand Down

0 comments on commit 26ee188

Please sign in to comment.