use of com.mercedesbenz.sechub.integrationtest.api.TestUser in project sechub by mercedes-benz.
the class SecHubExecutionScenarioSecHubClientIntTest method a_project_having_no_white_list_entries_but_some_problems_can_be_executed_as_codescan_and_results_yellow.
// we use startDownloadJobReport here - old implementation okay here
@SuppressWarnings("deprecation")
@Test
public void a_project_having_no_white_list_entries_but_some_problems_can_be_executed_as_codescan_and_results_yellow() {
/* @formatter:off */
/* prepare */
TestProject project = PROJECT_3;
TestUser user = USER_1;
assertProject(project).hasNoWhiteListEntries();
as(SUPER_ADMIN).assignUserToProject(user, project);
/* execute */
IntegrationTestJSONLocation location = CLIENT_JSON_SOURCESCAN_YELLOW_ZERO_WAIT;
UUID jobUUID = as(user).withSecHubClient().startAsynchronScanFor(project, location).assertFileUploaded(project).assertJobTriggered().getJobUUID();
waitForJobDoneAndFailWhenJobIsFailing(project, jobUUID);
as(user).withSecHubClient().startDownloadJobReport(project, jobUUID, location).hasTrafficLight(TrafficLight.YELLOW);
/* @formatter:on */
}
use of com.mercedesbenz.sechub.integrationtest.api.TestUser in project sechub by mercedes-benz.
the class SecHubExecutionScenarioSecHubClientIntTest method a_project_having_metadata_no_problems_can_be_executed_as_codescan_and_results_green.
// we use startDownloadJobReport here - old implementation okay here
@SuppressWarnings("deprecation")
@Test
public void a_project_having_metadata_no_problems_can_be_executed_as_codescan_and_results_green() {
/* @formatter:off */
/* prepare */
TestProject project = PROJECT_3;
TestUser user = USER_1;
assertProject(project).hasNoMetaData();
Map<String, String> metaData = new HashMap<>();
metaData.put("key1", "value1");
as(SUPER_ADMIN).assignUserToProject(user, project).updateMetaDataForProject(project, metaData);
assertProject(project).hasMetaData(metaData);
/* execute */
IntegrationTestJSONLocation location = CLIENT_JSON_SOURCESCAN_GREEN_ZERO_WAIT;
UUID jobUUID = as(user).withSecHubClient().startAsynchronScanFor(project, location).assertFileUploaded(project).assertJobTriggered().getJobUUID();
waitForJobDoneAndFailWhenJobIsFailing(project, jobUUID);
as(user).withSecHubClient().startDownloadJobReport(project, jobUUID, location).hasTrafficLight(TrafficLight.GREEN);
/* @formatter:on */
}
use of com.mercedesbenz.sechub.integrationtest.api.TestUser in project sechub by mercedes-benz.
the class SecHubExecutionScenarioSecHubClientIntTest method a_project_having_no_problems_can_be_executed_as_codescan_and_results_green.
// we use startDownloadJobReport here - old implementation okay here
@SuppressWarnings("deprecation")
@Test
public void a_project_having_no_problems_can_be_executed_as_codescan_and_results_green() {
/* @formatter:off */
/* prepare */
TestProject project = PROJECT_3;
TestUser user = USER_1;
assertProject(project).hasNoWhiteListEntries();
List<String> list = new ArrayList<>();
as(SUPER_ADMIN).updateWhiteListForProject(project, list).assignUserToProject(user, project);
/* execute */
IntegrationTestJSONLocation location = CLIENT_JSON_SOURCESCAN_GREEN_ZERO_WAIT;
UUID jobUUID = as(user).withSecHubClient().startAsynchronScanFor(project, location).assertFileUploaded(project).assertJobTriggered().getJobUUID();
waitForJobDoneAndFailWhenJobIsFailing(project, jobUUID);
as(user).withSecHubClient().startDownloadJobReport(project, jobUUID, location).hasTrafficLight(TrafficLight.GREEN);
/* @formatter:on */
}
use of com.mercedesbenz.sechub.integrationtest.api.TestUser in project sechub by mercedes-benz.
the class UserAdministrationScenario2IntTest method superadmin_can_grant_user_admin_rights_mails_are_sent_and_user_appears_as_expected_then.
/* +-----------------------------------------------------------------------+ */
/* +............................ User ......... ...........................+ */
/* +-----------------------------------------------------------------------+ */
/* @formatter:off */
@Test
public void superadmin_can_grant_user_admin_rights_mails_are_sent_and_user_appears_as_expected_then() {
TestUser userBecomingAdmin = USER_1;
/* execute grant +test */
assertUser(SUPER_ADMIN).canGrantSuperAdminRightsTo(userBecomingAdmin);
/* test behavior*/
assertUser(userBecomingAdmin).isSuperAdmin().isInSuperAdminList();
/* test notifications */
assertUser(userBecomingAdmin).hasReceivedEmail("SecHub administrator privileges granted");
assertMailExists("int-test_superadmins_npm@example.org", "SecHub: Granted administrator rights.*" + userBecomingAdmin.getUserId(), TextSearchMode.REGULAR_EXPRESSON);
}
use of com.mercedesbenz.sechub.integrationtest.api.TestUser in project sechub by mercedes-benz.
the class UserAdministrationScenario2IntTest method superadmin_can_revoke_user_admin_rights.
/* @formatter:off */
@Test
public void superadmin_can_revoke_user_admin_rights() {
/* prepare */
TestUser userNoMoreAdmin = USER_2;
as(SUPER_ADMIN).grantSuperAdminRightsTo(userNoMoreAdmin);
assertUser(userNoMoreAdmin).isSuperAdmin();
/* execute + test */
assertUser(SUPER_ADMIN).canRevokeSuperAdminRightsTo(userNoMoreAdmin);
/* test behavior*/
assertUser(userNoMoreAdmin).isNotSuperAdmin().isNotInSuperAdminList();
/* test notifications */
assertUser(userNoMoreAdmin).hasReceivedEmail("SecHub administrator privileges revoked");
assertMailExists("int-test_superadmins_npm@example.org", "SecHub: Revoked administrator rights.*" + userNoMoreAdmin.getUserId(), TextSearchMode.REGULAR_EXPRESSON);
}
Aggregations