Search in sources :

Example 6 with TestExecutorConfig

use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.

the class IntegrationTestDefaultExecutorConfigurations method defineNetsparkerConfig.

private static TestExecutorConfig defineNetsparkerConfig() {
    TestExecutorConfig config = createTestExecutorConfig();
    config.enabled = true;
    config.executorVersion = 1;
    config.productIdentifier = TestExecutorProductIdentifier.NETSPARKER.name();
    config.name = INTTEST_NAME_PREFIX + "Netsparker V1";
    config.setup.baseURL = "https://netsparker.example.com";
    config.setup.credentials.user = "netsparker-user";
    config.setup.credentials.password = "netsparker-password";
    // not initialized - is done at creation time by scenario initializer!
    config.uuid = null;
    return config;
}
Also used : TestExecutorConfig(com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig)

Example 7 with TestExecutorConfig

use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.

the class IntegrationTestDefaultExecutorConfigurations method defineCheckmarxConfig.

private static TestExecutorConfig defineCheckmarxConfig() {
    TestExecutorConfig config = createTestExecutorConfig();
    config.enabled = true;
    config.executorVersion = 1;
    config.productIdentifier = TestExecutorProductIdentifier.CHECKMARX.name();
    config.name = INTTEST_NAME_PREFIX + "Checkmarx V1";
    config.setup.baseURL = "https://checkmarx.mock.example.org:6011";
    config.setup.credentials.user = "checkmarx-user";
    config.setup.credentials.password = "checkmarx-password";
    // not initialized - is done at creation time by scenario initializer!
    config.uuid = null;
    MappingData teamIdMappingData = new MappingData();
    teamIdMappingData.getEntries().add(CHECKMARX_TEAMID_MAPPING_DEFAULT_MAPPING);
    MappingData presetIdMappingData = new MappingData();
    presetIdMappingData.getEntries().add(CHECKMARX_PRESETID_MAPPING_DEFAULT_MAPPING);
    List<TestExecutorSetupJobParam> jobParameters = config.setup.jobParameters;
    jobParameters.add(new TestExecutorSetupJobParam("checkmarx.newproject.teamid.mapping", teamIdMappingData.toJSON()));
    jobParameters.add(new TestExecutorSetupJobParam("checkmarx.newproject.presetid.mapping", presetIdMappingData.toJSON()));
    return config;
}
Also used : TestExecutorConfig(com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig) TestExecutorSetupJobParam(com.mercedesbenz.sechub.test.executorconfig.TestExecutorSetupJobParam) MappingData(com.mercedesbenz.sechub.sharedkernel.mapping.MappingData)

Example 8 with TestExecutorConfig

use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.

the class ProductExecutionProfileScenario7IntTest method sanity_check_remove_projects_implemented_correct_for_daui.

/* @formatter:off */
@Test
public void sanity_check_remove_projects_implemented_correct_for_daui() {
    /* prepare */
    String profileId = "test-profile-to-delete9";
    dropExecutionProfileIfExisting(profileId);
    profileData = new TestExecutionProfile();
    profileData.description = "test9";
    TestExecutorConfig config = new TestExecutorConfig();
    config.name = "config1";
    config.executorVersion = 33;
    config.productIdentifier = "PDS_WEBSCAN";
    config.setup.baseURL = "";
    UUID uuid1 = as(SUPER_ADMIN).createProductExecutorConfig(config);
    config.name = "config2";
    UUID uuid2 = as(SUPER_ADMIN).createProductExecutorConfig(config);
    config.name = "config3";
    UUID uuid3 = as(SUPER_ADMIN).createProductExecutorConfig(config);
    as(SUPER_ADMIN).createProductExecutionProfile(profileId, profileData).addConfigurationToProfile(profileId, uuid1, uuid2, uuid3).addProjectIdsToProfile(profileId, "p1", "p2", "p3");
    /* check preconditions */
    assertProfile(profileId).hasConfigurations(uuid1, uuid2, uuid3).hasProjectIds("p1", "p2", "p3");
    /* execute */
    as(SUPER_ADMIN).removeConfigurationFromProfile(profileId, uuid1, uuid3);
    as(SUPER_ADMIN).removeProjectIdsFromProfile(profileId, "p1", "p3");
    /* test */
    assertProfile(profileId).hasConfigurations(uuid2).hasProjectIds("p2");
}
Also used : TestExecutionProfile(com.mercedesbenz.sechub.test.executionprofile.TestExecutionProfile) TestExecutorConfig(com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig) UUID(java.util.UUID) Test(org.junit.Test)

Example 9 with TestExecutorConfig

use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.

the class ProductExecutionProfileScenario7IntTest method an_admin_can_NOT_update_a_profile_containing__a_configuration_and_define_another_projects.

@Test
public void an_admin_can_NOT_update_a_profile_containing__a_configuration_and_define_another_projects() {
    /* prepare */
    String profileId = "test-profile-to-delete8";
    dropExecutionProfileIfExisting(profileId);
    TestExecutionProfile profileData = new TestExecutionProfile();
    profileData.description = "test1";
    profileData.projectIds.add("project1");
    UUID uuid = createTestExecutorConfig();
    TestExecutorConfig config = new TestExecutorConfig(uuid);
    profileData.configurations.add(config);
    as(SUPER_ADMIN).createProductExecutionProfile(profileId, profileData);
    /* @formatter:off */
    assertProfile(profileId).hasDescritpion("test1").isNotEnabled().hasConfigurations(uuid).hasProjectIds("project1");
    /* now change local data - so changed when update done */
    // removes project1
    profileData.projectIds.clear();
    profileData.projectIds.add("project2");
    profileData.projectIds.add("project3");
    profileData.description = "changed description";
    profileData.enabled = true;
    /* execute */
    as(SUPER_ADMIN).updateProductExecutionProfile(profileId, profileData);
    /* test */
    assertProfile(profileId).isEnabled().hasDescritpion("changed description").hasConfigurations(uuid).hasProjectIds("project1");
/* @formatter:on */
}
Also used : TestExecutionProfile(com.mercedesbenz.sechub.test.executionprofile.TestExecutionProfile) TestExecutorConfig(com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig) UUID(java.util.UUID) Test(org.junit.Test)

Example 10 with TestExecutorConfig

use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.

the class ProductExecutionProfileScenario7IntTest method an_admin_can_delete_a_profile_when_a_project_is_related_and_also_add_again.

/* @formatter:on */
/* @formatter:off */
@Test
public void an_admin_can_delete_a_profile_when_a_project_is_related_and_also_add_again() {
    /* prepare */
    String profileId = "test-profile-to-delete2";
    dropExecutionProfileIfExisting(profileId);
    TestProject tempProject = setup.getScenario().newTestProject();
    String tempProjectProjectId = tempProject.getProjectId();
    TestExecutorConfig tempConfig = new TestExecutorConfig();
    tempConfig.name = "config1";
    tempConfig.setup.baseURL = "something";
    tempConfig.productIdentifier = "PDS_CODESCAN";
    tempConfig.executorVersion = 42;
    UUID uuid1 = as(SUPER_ADMIN).createProductExecutorConfig(tempConfig);
    tempConfig.name = "config2";
    UUID uuid2 = as(SUPER_ADMIN).createProductExecutorConfig(tempConfig);
    as(SUPER_ADMIN).createProductExecutionProfile(profileId, new TestExecutionProfile()).createProject(tempProject, Scenario7.OWNER_1.getUserId()).addConfigurationToProfile(profileId, uuid1, uuid2).addProjectsToProfile(profileId, tempProject);
    /* check precondition */
    assertProfile(profileId).hasProjectIds(tempProjectProjectId).hasConfigurations(uuid1, uuid2);
    /* execute */
    as(SUPER_ADMIN).deleteProductExecutionProfile(profileId);
    /* test */
    assertProfileDoesNotExist(profileId);
    /* prepare 2 - recrate same profile*/
    as(SUPER_ADMIN).createProductExecutionProfile(profileId, new TestExecutionProfile());
    /* test 2 - new project (with same id as before) has no relation to project, so really deleted */
    assertProfile(profileId).hasNoProjectIds().hasNoConfigurations();
    /* prepare 3 - add relation again */
    as(SUPER_ADMIN).addProjectsToProfile(profileId, tempProject);
    /* check relation is working again */
    assertProfile(profileId).hasNoConfigurations().hasProjectIds(tempProjectProjectId);
}
Also used : TestExecutionProfile(com.mercedesbenz.sechub.test.executionprofile.TestExecutionProfile) TestProject(com.mercedesbenz.sechub.integrationtest.api.TestProject) TestExecutorConfig(com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig) UUID(java.util.UUID) Test(org.junit.Test)

Aggregations

TestExecutorConfig (com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig)37 UUID (java.util.UUID)26 Test (org.junit.Test)17 TestExecutionProfile (com.mercedesbenz.sechub.test.executionprofile.TestExecutionProfile)14 TestExecutorSetupJobParam (com.mercedesbenz.sechub.test.executorconfig.TestExecutorSetupJobParam)13 UseCaseRestDoc (com.mercedesbenz.sechub.sharedkernel.usecases.UseCaseRestDoc)5 WebMvcTest (org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest)5 DeveloperAdministration (com.mercedesbenz.sechub.developertools.admin.DeveloperAdministration)1 TableRendersupport (com.mercedesbenz.sechub.developertools.admin.ui.TableRendersupport)1 ExecutorConfigDialogUI (com.mercedesbenz.sechub.developertools.admin.ui.action.config.ExecutorConfigDialogUI)1 ProductExecutionProfile (com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutionProfile)1 ProductExecutorConfig (com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfig)1 TestProject (com.mercedesbenz.sechub.integrationtest.api.TestProject)1 MappingData (com.mercedesbenz.sechub.sharedkernel.mapping.MappingData)1 UseCaseAdminCreatesExecutorConfiguration (com.mercedesbenz.sechub.sharedkernel.usecases.admin.config.UseCaseAdminCreatesExecutorConfiguration)1 UseCaseAdminFetchesExecutionProfile (com.mercedesbenz.sechub.sharedkernel.usecases.admin.config.UseCaseAdminFetchesExecutionProfile)1 UseCaseAdminFetchesExecutorConfiguration (com.mercedesbenz.sechub.sharedkernel.usecases.admin.config.UseCaseAdminFetchesExecutorConfiguration)1 UseCaseAdminUpdatesExecutionProfile (com.mercedesbenz.sechub.sharedkernel.usecases.admin.config.UseCaseAdminUpdatesExecutionProfile)1 UseCaseAdminUpdatesExecutorConfig (com.mercedesbenz.sechub.sharedkernel.usecases.admin.config.UseCaseAdminUpdatesExecutorConfig)1 TestExecutionProfileList (com.mercedesbenz.sechub.test.executionprofile.TestExecutionProfileList)1