Search in sources :

Example 1 with ProductExecutorConfigSetupJobParameter

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());
}
Also used : ProductExecutorConfigSetupJobParameter(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter) Test(org.junit.Test)

Example 2 with ProductExecutorConfigSetupJobParameter

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());
}
Also used : ProductExecutorConfigSetupJobParameter(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter) Test(org.junit.Test)

Example 3 with ProductExecutorConfigSetupJobParameter

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());
}
Also used : ProductExecutorConfigSetupJobParameter(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter) Test(org.junit.Test)

Example 4 with ProductExecutorConfigSetupJobParameter

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;
}
Also used : MappingEntry(com.mercedesbenz.sechub.sharedkernel.mapping.MappingEntry) ProductExecutorConfigSetupCredentials(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupCredentials) ProductExecutorConfigSetupJobParameter(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter) ArrayList(java.util.ArrayList) MappingData(com.mercedesbenz.sechub.sharedkernel.mapping.MappingData) ProductExecutorConfigSetup(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetup)

Example 5 with ProductExecutorConfigSetupJobParameter

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);
}
Also used : ProductExecutorConfigSetupJobParameter(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter) ProductExecutorConfig(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfig) ProductExecutorConfigSetup(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetup)

Aggregations

ProductExecutorConfigSetupJobParameter (com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter)13 Test (org.junit.Test)6 ProductExecutorConfig (com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfig)5 ProductExecutorConfigSetup (com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetup)5 ProductExecutorConfigSetupCredentials (com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupCredentials)3 SystemEnvironment (com.mercedesbenz.sechub.sharedkernel.SystemEnvironment)2 Before (org.junit.Before)2 ExecutionPDSKey (com.mercedesbenz.sechub.commons.pds.ExecutionPDSKey)1 PDSConfigDataKeyProvider (com.mercedesbenz.sechub.commons.pds.PDSConfigDataKeyProvider)1 PDSKey (com.mercedesbenz.sechub.commons.pds.PDSKey)1 MappingData (com.mercedesbenz.sechub.sharedkernel.mapping.MappingData)1 MappingEntry (com.mercedesbenz.sechub.sharedkernel.mapping.MappingEntry)1 ArrayList (java.util.ArrayList)1