use of com.mercedesbenz.sechub.adapter.checkmarx.CheckmarxSastScanSettings in project sechub by mercedes-benz.
the class CheckmarxProjectSupportTest method updateEngineCondfigurationIdWhenSecHubAndCheckmarxDiffer_same_engine_configuration_id.
@Test
public void updateEngineCondfigurationIdWhenSecHubAndCheckmarxDiffer_same_engine_configuration_id() {
/* prepare */
String engineConfigurationName = "test-configuration";
long engineConfigurationId = 5L;
List<CheckmarxEngineConfiguration> engineConfigurations = new LinkedList<>();
CheckmarxEngineConfiguration defaultConfiguration = new CheckmarxEngineConfiguration();
defaultConfiguration.setId(1L);
defaultConfiguration.setName("Default Configuration");
CheckmarxEngineConfiguration testConfiguration = new CheckmarxEngineConfiguration();
testConfiguration.setId(engineConfigurationId);
testConfiguration.setName(engineConfigurationName);
engineConfigurations.add(defaultConfiguration);
engineConfigurations.add(testConfiguration);
CheckmarxConfigBuilder builder = createBuilderWithMandatoryParamatersSet();
builder.setEngineConfigurationName(engineConfigurationName);
CheckmarxConfig config = builder.build();
CheckmarxSastScanSettings checkmarxScanSettings = new CheckmarxSastScanSettings();
checkmarxScanSettings.setEngineConfigurationId(engineConfigurationId);
InternalUpdateContext updateContext = supportToTest.new InternalUpdateContext();
/* execute */
supportToTest.updateEngineCondfigurationIdWhenSecHubAndCheckmarxDiffer(config, engineConfigurations, checkmarxScanSettings, updateContext);
/* test */
assertThat(updateContext.isUpdateOfEngineConfigurationNecessary(), is(false));
assertThat(updateContext.getEngineConfigurationId(), is(engineConfigurationId));
assertThat(updateContext.isUpdateNecessary(), is(false));
}
use of com.mercedesbenz.sechub.adapter.checkmarx.CheckmarxSastScanSettings in project sechub by mercedes-benz.
the class CheckmarxProjectSupportTest method updateEngineCondfigurationIdWhenSecHubAndCheckmarxDiffer_different_engine_configuration_id.
@Test
public void updateEngineCondfigurationIdWhenSecHubAndCheckmarxDiffer_different_engine_configuration_id() {
/* prepare */
String engineConfigurationName = "test-configuration";
long engineConfigurationId = 5L;
List<CheckmarxEngineConfiguration> engineConfigurations = new LinkedList<>();
CheckmarxEngineConfiguration defaultConfiguration = new CheckmarxEngineConfiguration();
defaultConfiguration.setId(1L);
defaultConfiguration.setName("Default Configuration");
CheckmarxEngineConfiguration testConfiguration = new CheckmarxEngineConfiguration();
testConfiguration.setId(engineConfigurationId);
testConfiguration.setName(engineConfigurationName);
engineConfigurations.add(defaultConfiguration);
engineConfigurations.add(testConfiguration);
CheckmarxConfigBuilder builder = createBuilderWithMandatoryParamatersSet();
builder.setEngineConfigurationName(engineConfigurationName);
CheckmarxConfig config = builder.build();
CheckmarxSastScanSettings checkmarxScanSettings = new CheckmarxSastScanSettings();
checkmarxScanSettings.setEngineConfigurationId(defaultConfiguration.getId());
InternalUpdateContext updateContext = supportToTest.new InternalUpdateContext();
/* execute */
supportToTest.updateEngineCondfigurationIdWhenSecHubAndCheckmarxDiffer(config, engineConfigurations, checkmarxScanSettings, updateContext);
/* test */
assertThat(updateContext.isUpdateOfEngineConfigurationNecessary(), is(true));
assertThat(updateContext.getEngineConfigurationId(), is(engineConfigurationId));
assertThat(updateContext.isUpdateNecessary(), is(true));
}
Aggregations