use of com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter in project sechub by mercedes-benz.
the class CheckmarxExecutorConfigSuppportTest method always_fullscan_enabled_true.
@Test
public void always_fullscan_enabled_true() {
/* prepare */
jobParameters.add(new ProductExecutorConfigSetupJobParameter(CheckmarxExecutorConfigParameterKeys.CHECKMARX_FULLSCAN_ALWAYS, "true"));
supportToTest = CheckmarxExecutorConfigSuppport.createSupportAndAssertConfigValid(config, systemEnvironment);
/* test */
assertEquals(true, supportToTest.isAlwaysFullScanEnabled());
}
use of com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter in project sechub by mercedes-benz.
the class CheckmarxExecutorConfigSuppportTest method client_secret_returns_configured_value_when_parameter_available.
@Test
public void client_secret_returns_configured_value_when_parameter_available() {
/* prepare */
jobParameters.add(new ProductExecutorConfigSetupJobParameter(CheckmarxExecutorConfigParameterKeys.CHECKMARX_CLIENT_SECRET, "new.secret"));
supportToTest = CheckmarxExecutorConfigSuppport.createSupportAndAssertConfigValid(config, systemEnvironment);
/* execute +test */
assertEquals("new.secret", supportToTest.getClientSecret());
}
use of com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter in project sechub by mercedes-benz.
the class CheckmarxExecutorConfigSuppportTest method engine_configuration_name_returns_an_empty_string_default_is_returned.
@Test
public void engine_configuration_name_returns_an_empty_string_default_is_returned() {
/* prepare */
jobParameters.add(new ProductExecutorConfigSetupJobParameter(CheckmarxExecutorConfigParameterKeys.CHECKMARX_ENGINE_CONFIGURATIONNAME, ""));
supportToTest = CheckmarxExecutorConfigSuppport.createSupportAndAssertConfigValid(config, systemEnvironment);
/* execute +test */
assertEquals(CheckmarxConstants.DEFAULT_CHECKMARX_ENGINECONFIGURATION_MULTILANGANGE_SCAN_NAME, supportToTest.getEngineConfigurationName());
}
use of com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter in project sechub by mercedes-benz.
the class CheckmarxProductExecutorMockTest method createCheckmarxSetupWithAllMandotoryPartsSet.
private ProductExecutorConfigSetup createCheckmarxSetupWithAllMandotoryPartsSet() {
ProductExecutorConfigSetup setup = mock(ProductExecutorConfigSetup.class);
ProductExecutorConfigSetupCredentials credentials = mock(ProductExecutorConfigSetupCredentials.class);
when(setup.getCredentials()).thenReturn(credentials);
when(credentials.getUser()).thenReturn("user");
when(credentials.getPassword()).thenReturn("pwd");
List<ProductExecutorConfigSetupJobParameter> jobParameters = new ArrayList<>();
MappingData data = new MappingData();
data.getEntries().add(new MappingEntry(".*", "teamId1", ""));
jobParameters.add(new ProductExecutorConfigSetupJobParameter(MappingIdentifier.CHECKMARX_NEWPROJECT_TEAM_ID.getId(), data.toJSON()));
when(setup.getJobParameters()).thenReturn(jobParameters);
return setup;
}
use of com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter in project sechub by mercedes-benz.
the class PDSProductExecutorMinimumConfigValidation method validate.
@Override
protected void validate(ValidationContext<ProductExecutorConfig> context) {
/* check not null... */
validateNotNull(context);
ProductExecutorConfig configToValidate = getObjectToValidate(context);
if (configToValidate == null) {
return;
}
ProductExecutorConfigSetup setup = configToValidate.getSetup();
validateNotNull(context, setup, "setup");
if (setup == null) {
return;
}
List<ProductExecutorConfigSetupJobParameter> jobParameters = setup.getJobParameters();
validateNotNull(context, jobParameters, "jobParameters");
if (jobParameters == null) {
return;
}
validateMandatoryPartsSet(context, jobParameters);
}
Aggregations