use of com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupCredentials 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.ProductExecutorConfigSetupCredentials in project sechub by mercedes-benz.
the class DefaultExecutorConfigSupport method getPasswordOrAPIToken.
public String getPasswordOrAPIToken() {
ProductExecutorConfigSetupCredentials credentials = config.getSetup().getCredentials();
String pwd = credentials.getPassword();
return evaluateEnvironmentEntry(pwd);
}
use of com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupCredentials 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.ProductExecutorConfigSetupCredentials in project sechub by mercedes-benz.
the class DefaultExecutorConfigSupport method getUser.
public String getUser() {
ProductExecutorConfigSetupCredentials credentials = config.getSetup().getCredentials();
String user = credentials.getUser();
return evaluateEnvironmentEntry(user);
}
use of com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfigSetupCredentials 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);
}
Aggregations