Search in sources :

Example 16 with IntegrationTestJSONLocation

use of com.mercedesbenz.sechub.integrationtest.api.IntegrationTestJSONLocation in project sechub by mercedes-benz.

the class FalsePositivesScenario3IntTest method REST_API_direct_fetch_fp_config_when_one_entry_added.

@Test
public void REST_API_direct_fetch_fp_config_when_one_entry_added() throws Exception {
    /* @formatter:off */
    /**
     ********
     */
    /* prepare */
    /**
     ********
     */
    IntegrationTestJSONLocation location = IntegrationTestJSONLocation.CLIENT_JSON_SOURCESCAN_YELLOW_ZERO_WAIT;
    ExecutionResult result = as(USER_1).withSecHubClient().startSynchronScanFor(project, location);
    assertReportUnordered(result).finding().id(1).name("Absolute Path Traversal").isContained().hasTrafficLight(TrafficLight.YELLOW);
    UUID jobUUID = result.getSechubJobUUID();
    as(USER_1).startFalsePositiveDefinition(project).add(1, jobUUID).markAsFalsePositive();
    /**
     ********
     */
    /* execute */
    /**
     ********
     */
    ProjectFalsePositivesDefinition configuration = as(USER_1).getFalsePositiveConfigurationOfProject(project);
    /**
     *****
     */
    /* test */
    /**
     *****
     */
    assertTrue(configuration.isContaining(1, jobUUID));
/* @formatter:on */
}
Also used : IntegrationTestJSONLocation(com.mercedesbenz.sechub.integrationtest.api.IntegrationTestJSONLocation) ExecutionResult(com.mercedesbenz.sechub.integrationtest.internal.SecHubClientExecutor.ExecutionResult) ProjectFalsePositivesDefinition(com.mercedesbenz.sechub.integrationtest.api.AsUser.ProjectFalsePositivesDefinition) UUID(java.util.UUID) Test(org.junit.Test)

Example 17 with IntegrationTestJSONLocation

use of com.mercedesbenz.sechub.integrationtest.api.IntegrationTestJSONLocation in project sechub by mercedes-benz.

the class ProjectChangeAccessLevelScenario3IntTest method a_delete_removes_former_access_level_settings.

/* @formatter:off */
@Test
public void a_delete_removes_former_access_level_settings() throws Exception {
    /* prepare + test preconditions */
    TestProject project = PROJECT_1;
    as(SUPER_ADMIN).changeProjectAccessLevel(project, ProjectAccessLevel.NONE);
    assertProject(project).hasAccessLevel(ProjectAccessLevel.NONE);
    /* execute */
    as(SUPER_ADMIN).deleteProject(project);
    /* test*/
    waitProjectDoesNotExist(project);
    // now we create a new project with same name etc.
    as(SUPER_ADMIN).createProject(project, USER_1.getUserId()).addProjectsToProfile(ExecutionConstants.DEFAULT_EXECUTION_PROFILE_ID, project).assignUserToProject(USER_1, project);
    // now we test that the acces level is full... and not NONE as before the delete...
    assertProject(project).hasAccessLevel(ProjectAccessLevel.FULL);
    // we start a job by USER1 and download the results- at this moment, this is possible, because project access level of new project is "FULL"
    IntegrationTestJSONLocation location = IntegrationTestJSONLocation.CLIENT_JSON_SOURCESCAN_YELLOW;
    ExecutionResult result = as(USER_1).withSecHubClient().startSynchronScanFor(project, location);
    assertSecHubReport(result).hasTrafficLight(TrafficLight.YELLOW);
}
Also used : TestProject(com.mercedesbenz.sechub.integrationtest.api.TestProject) IntegrationTestJSONLocation(com.mercedesbenz.sechub.integrationtest.api.IntegrationTestJSONLocation) ExecutionResult(com.mercedesbenz.sechub.integrationtest.internal.SecHubClientExecutor.ExecutionResult) Test(org.junit.Test)

Aggregations

IntegrationTestJSONLocation (com.mercedesbenz.sechub.integrationtest.api.IntegrationTestJSONLocation)17 Test (org.junit.Test)17 UUID (java.util.UUID)16 TestProject (com.mercedesbenz.sechub.integrationtest.api.TestProject)10 ExecutionResult (com.mercedesbenz.sechub.integrationtest.internal.SecHubClientExecutor.ExecutionResult)9 TestUser (com.mercedesbenz.sechub.integrationtest.api.TestUser)8 LinkedHashMap (java.util.LinkedHashMap)4 ProjectFalsePositivesDefinition (com.mercedesbenz.sechub.integrationtest.api.AsUser.ProjectFalsePositivesDefinition)3 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)2 JSonMessageHttpStatusExceptionTestValidator (com.mercedesbenz.sechub.integrationtest.api.JSonMessageHttpStatusExceptionTestValidator)1