Search in sources :

Example 31 with TestExecutorConfig

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);
}
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 32 with TestExecutorConfig

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);
}
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 33 with TestExecutorConfig

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);
}
Also used : TestExecutorConfigList(com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfigList) TestExecutorConfig(com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig) UUID(java.util.UUID) TestExecutorConfigListEntry(com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfigListEntry) Test(org.junit.Test)

Example 34 with TestExecutorConfig

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 */
}
Also used : TestExecutorConfig(com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig) TestExecutorSetupJobParam(com.mercedesbenz.sechub.test.executorconfig.TestExecutorSetupJobParam) UUID(java.util.UUID) Test(org.junit.Test)

Example 35 with TestExecutorConfig

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 */
}
Also used : TestExecutorConfig(com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig) TestExecutorSetupJobParam(com.mercedesbenz.sechub.test.executorconfig.TestExecutorSetupJobParam) 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