use of com.mercedesbenz.sechub.integrationtest.api.TestProject in project sechub by mercedes-benz.
the class SecHubExecutionScenarioSecHubClientIntTest method sechub_client_can_execute_a_config_file_which_uses_template_variables_of_environment_entries.
// we use startDownloadJobReport here - old implementation okay here
@SuppressWarnings("deprecation")
@Test
public void sechub_client_can_execute_a_config_file_which_uses_template_variables_of_environment_entries() {
/* @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);
Map<String, String> envEntries = new LinkedHashMap<>();
envEntries.put("SHTEST_VERSION", "1.0");
envEntries.put("SHTEST_FOLDERS1", IntegrationTestMockMode.CODE_SCAN__CHECKMARX__GREEN__FAST.getTarget());
/* execute */
IntegrationTestJSONLocation location = CLIENT_JSON_SOURCESCAN_GENERIC_TEMPLATE;
UUID jobUUID = as(user).withSecHubClient().startAsynchronScanFor(project, location, envEntries).assertFileUploaded(project).assertJobTriggered().getJobUUID();
waitForJobDoneAndFailWhenJobIsFailing(project, jobUUID);
/* why test green result ? Because we set test folders in a way we
* will expect green traffic light - which is only the case when
* we have an explicit path set by the environment entry inside
* template... We could also rely on server validation of version
* but this way is better, because we rely on test environment /mocked
* adapter behavior which is well known.
*/
as(user).withSecHubClient().startDownloadJobReport(project, jobUUID, location).hasTrafficLight(TrafficLight.GREEN);
/* @formatter:on */
}
use of com.mercedesbenz.sechub.integrationtest.api.TestProject in project sechub by mercedes-benz.
the class ProjectChangeAccessLevelScenario3IntTest method none___user_1_cannot_create_new_job.
/* @formatter:on */
/* @formatter:off */
@Test
public void none___user_1_cannot_create_new_job() throws Exception {
/* prepare + test preconditions */
TestProject project = PROJECT_1;
/* execute */
as(SUPER_ADMIN).changeProjectAccessLevel(project, ProjectAccessLevel.NONE);
/* test */
expectHttpFailure(() -> {
as(USER_1).createWebScan(project);
}, HttpStatus.FORBIDDEN);
}
use of com.mercedesbenz.sechub.integrationtest.api.TestProject in project sechub by mercedes-benz.
the class ProjectChangeAccessLevelScenario3IntTest method admin_changes_project_state_to_no_access_project_details_contains_the_information.
/* @formatter:on */
/* @formatter:off */
@Test
public void admin_changes_project_state_to_no_access_project_details_contains_the_information() throws Exception {
/* prepare + test preconditions */
TestProject project = PROJECT_1;
/* execute */
as(SUPER_ADMIN).changeProjectAccessLevel(project, ProjectAccessLevel.NONE);
/* test */
assertProject(project).hasAccessLevel(ProjectAccessLevel.NONE);
}
use of com.mercedesbenz.sechub.integrationtest.api.TestProject in project sechub by mercedes-benz.
the class ProjectChangeAccessLevelScenario3IntTest method read_only___user_1_cannot_approve_existing_job.
/* @formatter:on */
/* @formatter:off */
@Test
public void read_only___user_1_cannot_approve_existing_job() throws Exception {
/* prepare + test preconditions */
TestProject project = PROJECT_1;
UUID jobUUID = as(USER_1).createWebScan(project);
/* execute */
as(SUPER_ADMIN).changeProjectAccessLevel(project, ProjectAccessLevel.READ_ONLY);
/* test */
expectHttpFailure(() -> {
as(USER_1).approveJob(project, jobUUID);
}, HttpStatus.FORBIDDEN);
}
use of com.mercedesbenz.sechub.integrationtest.api.TestProject in project sechub by mercedes-benz.
the class ProjectChangeAccessLevelScenario3IntTest method none___user_1_cannot_approve_existing_job.
/* @formatter:on */
/* @formatter:off */
@Test
public void none___user_1_cannot_approve_existing_job() throws Exception {
/* prepare + test preconditions */
TestProject project = PROJECT_1;
UUID jobUUID = as(USER_1).createWebScan(project);
/* execute */
as(SUPER_ADMIN).changeProjectAccessLevel(project, ProjectAccessLevel.NONE);
/* test */
expectHttpFailure(() -> {
as(USER_1).approveJob(project, jobUUID);
}, HttpStatus.FORBIDDEN);
}
Aggregations