use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.
the class ProductExecutionProfileScenario7IntTest method an_admin_can_fetch_an_existing_profile_.
@Test
public void an_admin_can_fetch_an_existing_profile_() {
/* prepare */
String profileId = "test-profile-to-delete6";
dropExecutionProfileIfExisting(profileId);
profileData = new TestExecutionProfile();
profileData.description = "test1234";
profileData.projectIds.add("project1");
UUID uuid = createTestExecutorConfig();
// use created uuid for parameter
TestExecutorConfig config = new TestExecutorConfig(uuid);
profileData.configurations.add(config);
as(SUPER_ADMIN).createProductExecutionProfile(profileId, profileData);
/* execute */
TestExecutionProfile result = as(SUPER_ADMIN).fetchProductExecutionProfile(profileId);
/* test */
assertNotNull(result);
assertEquals("test1234", result.description);
}
use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.
the class ProductExecutionProfileScenario7IntTest method an_admin_can_create_a_new_profile_containing_already_a_configuration.
@Test
public void an_admin_can_create_a_new_profile_containing_already_a_configuration() {
/* prepare */
String profileId = "test-profile-to-delete5";
dropExecutionProfileIfExisting(profileId);
profileData = new TestExecutionProfile();
profileData.description = "test1";
profileData.projectIds.add("project1");
UUID uuid = createTestExecutorConfig();
// use created uuid for parameter
TestExecutorConfig config = new TestExecutorConfig(uuid);
profileData.configurations.add(config);
/* execute */
as(SUPER_ADMIN).createProductExecutionProfile(profileId, profileData);
/* test */
assertProfile(profileId).hasDescritpion("test1").hasConfigurations(uuid);
}
use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.
the class ProductExecutorConfigurationScenario7IntTest method an_admin_can_fetch_product_configuration_list.
@Test
public void an_admin_can_fetch_product_configuration_list() {
/* prepare */
TestExecutorConfig config = new TestExecutorConfig();
config.productIdentifier = TestExecutorProductIdentifier.PDS_CODESCAN.name();
config.name = "pds gosec-forlist-check";
config.executorVersion = 1;
config.enabled = true;
config.setup.baseURL = "https://baseurl.product.example.com/start";
UUID uuid = as(SUPER_ADMIN).createProductExecutorConfig(config);
assertNotNull(uuid);
/* execute */
TestExecutorConfigList result = as(SUPER_ADMIN).fetchProductExecutorConfigList();
/* test */
TestExecutorConfigListEntry found = resolveEntry(uuid, result);
if (found == null) {
fail("Did not found an config list entry with uuid:" + uuid + "\n" + JSONConverter.get().toJSON(result, true));
}
assertEquals("pds gosec-forlist-check", found.name);
assertTrue(found.enabled);
}
use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.
the class ProductExecutorConfigurationScenario7IntTest method an_admin_can_fetch_former_created_product_executor_config.
@Test
public void an_admin_can_fetch_former_created_product_executor_config() {
/* prepare */
TestExecutorConfig config = new TestExecutorConfig();
config.productIdentifier = TestExecutorProductIdentifier.PDS_CODESCAN.name();
config.name = "pds gosec-1";
config.executorVersion = 1;
config.setup.baseURL = "https://baseurl.product.example.com/start";
config.setup.jobParameters.add(new TestExecutorSetupJobParam("key1", "value1"));
config.setup.jobParameters.add(new TestExecutorSetupJobParam("key2", "value2"));
UUID uuid = as(SUPER_ADMIN).createProductExecutorConfig(config);
/* execute */
TestExecutorConfig fetchedConfig = as(SUPER_ADMIN).fetchProductExecutorConfig(uuid);
/* test */
/* @formatter:off */
assertNotNull(fetchedConfig);
assertConfig(uuid).hasBaseURL("https://baseurl.product.example.com/start").hasJobParameter("key1", "value1").hasJobParameter("key2", "value2");
/* @formatter:on */
}
use of com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig in project sechub by mercedes-benz.
the class ProductExecutorConfigurationScenario7IntTest method an_admin_can_update_former_created_product_executor_config.
@Test
public void an_admin_can_update_former_created_product_executor_config() {
/* @formatter:off */
/* prepare */
TestExecutorConfig config = new TestExecutorConfig();
config.productIdentifier = TestExecutorProductIdentifier.PDS_CODESCAN.name();
config.name = "pds gosec-1";
config.executorVersion = 1;
config.setup.baseURL = "https://baseurl.product.example.com/start";
config.setup.jobParameters.add(new TestExecutorSetupJobParam("key1", "value1"));
config.setup.jobParameters.add(new TestExecutorSetupJobParam("key2", "value2"));
UUID uuid = as(SUPER_ADMIN).createProductExecutorConfig(config);
assertConfig(uuid).hasBaseURL("https://baseurl.product.example.com/start").isNotEnabled().hasJobParameters(2);
TestExecutorConfig config2 = new TestExecutorConfig();
config2.productIdentifier = TestExecutorProductIdentifier.PDS_INFRASCAN.name();
config2.name = "pds gosec-1-renamed";
config2.executorVersion = 2;
config2.enabled = true;
config2.setup.baseURL = "https://baseurl.product-changed.example.com/start";
config2.setup.jobParameters.add(new TestExecutorSetupJobParam("key3", "value3"));
/* execute */
as(SUPER_ADMIN).updateProdcutExecutorConfig(uuid, config2);
/* test */
assertConfig(uuid).hasBaseURL("https://baseurl.product-changed.example.com/start").hasName("pds gosec-1-renamed").hasJobParameters(1).isEnabled().hasJobParameter("key3", "value3");
/* @formatter:on */
}
Aggregations