Search in sources :

Example 1 with ProjectFalsePositivesDefinition

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

the class FalsePositivesScenario3IntTest method with_sechubclient_fetch_fp_config_when_one_entry_added.

@Test
public void with_sechubclient_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).withSecHubClient().getFalsePositiveConfigurationOfProject(project, location);
    /**
     *****
     */
    /* 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 2 with ProjectFalsePositivesDefinition

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

the class FalsePositivesScenario3IntTest method REST_API_direct_mark_20_false_positives_with_comments_is_accepted.

@Test
public void REST_API_direct_mark_20_false_positives_with_comments_is_accepted() throws Exception {
    /* @formatter:off */
    /**
     ********
     */
    /* prepare */
    /**
     ********
     */
    IntegrationTestJSONLocation location = IntegrationTestJSONLocation.CLIENT_JSON_SOURCESCAN_YELLOW_ZERO_WAIT;
    ExecutionResult result = as(USER_1).withSecHubClient().startSynchronScanFor(project, location);
    UUID jobUUID = result.getSechubJobUUID();
    /**
     ********
     */
    /* execute */
    /**
     ********
     */
    ProjectFalsePositivesDefinition def = as(USER_1).startFalsePositiveDefinition(project);
    int loops = 20;
    for (int i = 1; i < loops; i++) {
        def.add(i, jobUUID, "comment for loop:" + i);
    }
    def.markAsFalsePositive();
    /**
     *****
     */
    /* test */
    /**
     *****
     */
    ProjectFalsePositivesDefinition configuration = as(USER_1).getFalsePositiveConfigurationOfProject(project);
    configuration.isContaining(loops - 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 3 with ProjectFalsePositivesDefinition

use of com.mercedesbenz.sechub.integrationtest.api.AsUser.ProjectFalsePositivesDefinition 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)

Aggregations

ProjectFalsePositivesDefinition (com.mercedesbenz.sechub.integrationtest.api.AsUser.ProjectFalsePositivesDefinition)3 IntegrationTestJSONLocation (com.mercedesbenz.sechub.integrationtest.api.IntegrationTestJSONLocation)3 ExecutionResult (com.mercedesbenz.sechub.integrationtest.internal.SecHubClientExecutor.ExecutionResult)3 UUID (java.util.UUID)3 Test (org.junit.Test)3