Search in sources :

Example 1 with SystemEnvironment

use of com.mercedesbenz.sechub.sharedkernel.SystemEnvironment 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);
}
Also used : SystemEnvironment(com.mercedesbenz.sechub.sharedkernel.SystemEnvironment) ProductExecutorConfigSetupJobParameter(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter) ProductExecutorConfigSetupCredentials(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupCredentials) ProductExecutorConfig(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfig) ProductExecutorConfigSetup(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetup) Before(org.junit.Before)

Example 2 with SystemEnvironment

use of com.mercedesbenz.sechub.sharedkernel.SystemEnvironment in project sechub by mercedes-benz.

the class PDSExecutorConfigSuppportTest method before.

@Before
public void before() throws Exception {
    config = mock(ProductExecutorConfig.class);
    setup = mock(ProductExecutorConfigSetup.class);
    jobParameters = new ArrayList<>();
    jobParameters.add(new ProductExecutorConfigSetupJobParameter(PDSConfigDataKeyProvider.PDS_CONFIG_PRODUCTIDENTIFIER.getKey().getId(), CONFIGURED_PDS_PRODUCT_IDENTIFIER));
    jobParameters.add(new ProductExecutorConfigSetupJobParameter(SecHubProductExecutionPDSKeyProvider.PDS_FORBIDS_TARGETTYPE_INTERNET.getKey().getId(), "true"));
    jobParameters.add(new ProductExecutorConfigSetupJobParameter(SecHubProductExecutionPDSKeyProvider.PDS_FORBIDS_TARGETTYPE_INTRANET.getKey().getId(), "false"));
    when(config.getSetup()).thenReturn(setup);
    credentialsInConfigSetup = new ProductExecutorConfigSetupCredentials();
    when(setup.getCredentials()).thenReturn(credentialsInConfigSetup);
    when(setup.getJobParameters()).thenReturn(jobParameters);
    systemEnvironment = mock(SystemEnvironment.class);
    supportToTest = PDSExecutorConfigSuppport.createSupportAndAssertConfigValid(config, systemEnvironment);
}
Also used : SystemEnvironment(com.mercedesbenz.sechub.sharedkernel.SystemEnvironment) ProductExecutorConfigSetupJobParameter(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter) ProductExecutorConfigSetupCredentials(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupCredentials) ProductExecutorConfig(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfig) ProductExecutorConfigSetup(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetup) Before(org.junit.Before)

Aggregations

ProductExecutorConfig (com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfig)2 ProductExecutorConfigSetup (com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetup)2 ProductExecutorConfigSetupCredentials (com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupCredentials)2 ProductExecutorConfigSetupJobParameter (com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupJobParameter)2 SystemEnvironment (com.mercedesbenz.sechub.sharedkernel.SystemEnvironment)2 Before (org.junit.Before)2