use of com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter in project sechub by mercedes-benz.
the class PDSProductExecutorMinimumConfigValidationTest method createConfigWithAllMandatoryParametersSetWith.
private ProductExecutorConfig createConfigWithAllMandatoryParametersSetWith(String value) {
ProductExecutorConfig config = createConfigWithNoParametersSet();
List<ProductExecutorConfigSetupJobParameter> params = config.getSetup().getJobParameters();
for (SecHubProductExecutionPDSKeyProvider provider : SecHubProductExecutionPDSKeyProvider.values()) {
SecHubProductExecutionPDSKey key = provider.getKey();
if (key.isMandatory()) {
params.add(new ProductExecutorConfigSetupJobParameter(key.getId(), value));
}
}
for (PDSConfigDataKeyProvider provider : PDSConfigDataKeyProvider.values()) {
ExecutionPDSKey key = provider.getKey();
if (key.isMandatory()) {
params.add(new ProductExecutorConfigSetupJobParameter(key.getId(), value));
}
}
return config;
}
use of com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter in project sechub by mercedes-benz.
the class DefaultExecutorConfigSupportTest method before.
@Before
public void before() throws Exception {
config = mock(ProductExecutorConfig.class);
setup = mock(ProductExecutorConfigSetup.class);
jobParameters = new ArrayList<>();
jobParameters.add(new ProductExecutorConfigSetupJobParameter("key1", "value1"));
jobParameters.add(new ProductExecutorConfigSetupJobParameter("key2", "2"));
jobParameters.add(new ProductExecutorConfigSetupJobParameter("key3", "true"));
jobParameters.add(new ProductExecutorConfigSetupJobParameter("key4", "false"));
jobParameters.add(new ProductExecutorConfigSetupJobParameter("key5", "TRUE"));
jobParameters.add(new ProductExecutorConfigSetupJobParameter("key6", null));
when(config.getSetup()).thenReturn(setup);
credentialsInConfigSetup = new ProductExecutorConfigSetupCredentials();
when(setup.getCredentials()).thenReturn(credentialsInConfigSetup);
when(setup.getJobParameters()).thenReturn(jobParameters);
systemEnvironment = mock(SystemEnvironment.class);
supportToTest = new DefaultExecutorConfigSupport(config, systemEnvironment, null);
}
use of com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter in project sechub by mercedes-benz.
the class CheckmarxExecutorConfigSuppportTest method client_secret_returns_an_empty_string_default_is_returned.
@Test
public void client_secret_returns_an_empty_string_default_is_returned() {
/* prepare */
jobParameters.add(new ProductExecutorConfigSetupJobParameter(CheckmarxExecutorConfigParameterKeys.CHECKMARX_CLIENT_SECRET, ""));
supportToTest = CheckmarxExecutorConfigSuppport.createSupportAndAssertConfigValid(config, systemEnvironment);
/* execute +test */
assertEquals(CheckmarxConstants.DEFAULT_CLIENT_SECRET, supportToTest.getClientSecret());
}
use of com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter in project sechub by mercedes-benz.
the class CheckmarxExecutorConfigSuppportTest method always_fullscan_enabled_false.
@Test
public void always_fullscan_enabled_false() {
/* prepare */
jobParameters.add(new ProductExecutorConfigSetupJobParameter(CheckmarxExecutorConfigParameterKeys.CHECKMARX_FULLSCAN_ALWAYS, "false"));
supportToTest = CheckmarxExecutorConfigSuppport.createSupportAndAssertConfigValid(config, systemEnvironment);
/* test */
assertEquals(false, supportToTest.isAlwaysFullScanEnabled());
}
use of com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter in project sechub by mercedes-benz.
the class CheckmarxExecutorConfigSuppportTest method engine_configuration_name_returns_configured_value_when_parameter_available.
@Test
public void engine_configuration_name_returns_configured_value_when_parameter_available() {
/* prepare */
jobParameters.add(new ProductExecutorConfigSetupJobParameter(CheckmarxExecutorConfigParameterKeys.CHECKMARX_ENGINE_CONFIGURATIONNAME, "test.engine"));
supportToTest = CheckmarxExecutorConfigSuppport.createSupportAndAssertConfigValid(config, systemEnvironment);
/* execute +test */
assertEquals("test.engine", supportToTest.getEngineConfigurationName());
}
Aggregations