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;
}
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;
}
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");
}
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 */
}
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);
}
Aggregations