Search in sources :

Example 26 with TestExecutorConfig

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

the class AssertExecutionProfile method hasConfigurations.

public AssertExecutionProfile hasConfigurations(UUID... uuids) {
    runWithRetries(5, () -> {
        for (UUID uuid : uuids) {
            TestExecutorConfig found = null;
            for (TestExecutorConfig config : config.configurations) {
                if (config.uuid.equals(uuid)) {
                    found = config;
                    break;
                }
            }
            assertNotNull("project did not contain configuration with uuid :" + uuid, found);
        }
        assertEquals("Expected configurations found, but there are additional ones", uuids.length, config.configurations.size());
    }, () -> {
        /* reload the config so we got current state */
        config = fetchConfig(config.id);
    });
    return this;
}
Also used : TestExecutorConfig(com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig) UUID(java.util.UUID)

Example 27 with TestExecutorConfig

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

the class AssertExecutorConfig method assertConfig.

public static AssertExecutorConfig assertConfig(UUID uuid) {
    TestExecutorConfig config = fetchConfig(uuid);
    assertNotNull(config);
    return new AssertExecutorConfig(config);
}
Also used : TestExecutorConfig(com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig)

Example 28 with TestExecutorConfig

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

the class EditConfigurationAction method executeDirectly.

/**
 * Executes action
 *
 * @param uuid
 * @return true when update was done, otherwise false
 */
public boolean executeDirectly(UUID uuid) {
    TestExecutorConfig config = getContext().getAdministration().fetchExecutorConfiguration(uuid);
    /* dump to output */
    outputAsTextOnSuccess("Config:" + uuid + " ass JSON:\n" + JSONConverter.get().toJSON(config, true));
    ExecutorConfigDialogUI ui = new ExecutorConfigDialogUI(getContext(), "Edit existing executor config", config);
    ui.setTextForOKButton("Update configuration");
    ui.showDialog();
    if (!ui.isOkPressed()) {
        return false;
    }
    TestExecutorConfig updatedConfig = ui.getUpdatedConfig();
    if (updatedConfig == null) {
        return false;
    }
    getContext().getAdministration().updateExecutorConfiguration(updatedConfig);
    outputAsTextOnSuccess("executor config updated:\n" + JSONConverter.get().toJSON(updatedConfig, true));
    return true;
}
Also used : TestExecutorConfig(com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig)

Example 29 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_containing__a_configuration.

@Test
public void an_admin_can_delete_a_profile_containing__a_configuration() {
    /* prepare */
    String profileId = "test-profile-to-delete7";
    dropExecutionProfileIfExisting(profileId);
    TestExecutionProfile 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);
    as(SUPER_ADMIN).createProductExecutionProfile(profileId, profileData);
    /* execute */
    as(SUPER_ADMIN).deleteProductExecutionProfile(profileId);
    /* test */
    assertProfileDoesNotExist(profileId);
}
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 30 with TestExecutorConfig

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

the class ProductExecutionProfileScenario7IntTest method createTestExecutorConfig.

private UUID createTestExecutorConfig() {
    TestExecutorConfig config = new TestExecutorConfig();
    config.productIdentifier = TestExecutorProductIdentifier.PDS_CODESCAN.name();
    config.name = "pds gosec-1";
    config.executorVersion = 1;
    config.enabled = false;
    config.setup.baseURL = "https://baseurl.product.example.com/start";
    UUID uuid = as(SUPER_ADMIN).createProductExecutorConfig(config);
    return uuid;
}
Also used : TestExecutorConfig(com.mercedesbenz.sechub.test.executorconfig.TestExecutorConfig) UUID(java.util.UUID)

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