use of com.mercedesbenz.sechub.commons.model.SecHubFileSystemConfiguration in project sechub by mercedes-benz.
the class CheckmarxProductExecutorMockTest method createExecutionContextForPseudoCodeScan.
private SecHubExecutionContext createExecutionContextForPseudoCodeScan() {
SecHubExecutionContext context = mock(SecHubExecutionContext.class);
SecHubConfiguration config = new SecHubConfiguration();
config.setProjectId(PROJECT_EXAMPLE);
SecHubCodeScanConfiguration codeScan = new SecHubCodeScanConfiguration();
SecHubFileSystemConfiguration fileSystemConfig = new SecHubFileSystemConfiguration();
fileSystemConfig.getFolders().add(PATH_EXAMPLE1);
codeScan.setFileSystem(fileSystemConfig);
config.setCodeScan(codeScan);
when(context.getConfiguration()).thenReturn(config);
return context;
}
use of com.mercedesbenz.sechub.commons.model.SecHubFileSystemConfiguration in project sechub by mercedes-benz.
the class SecHubFileStructureDataProviderBuilderTest method for_scanType_codescan_and_model_with_codescan_embedded_filesystem_builder_creates_a_configuration.
@Test
void for_scanType_codescan_and_model_with_codescan_embedded_filesystem_builder_creates_a_configuration() {
/* prepare */
SecHubConfigurationModel model = new SecHubConfigurationModel();
SecHubCodeScanConfiguration codeScan = new SecHubCodeScanConfiguration();
SecHubFileSystemConfiguration fileSystemConfiguration = new SecHubFileSystemConfiguration();
codeScan.setFileSystem(fileSystemConfiguration);
fileSystemConfiguration.getFolders().add("myfolder");
model.setCodeScan(codeScan);
/* execute */
SecHubFileStructureDataProvider configuration = builderToTest.setModel(model).setScanType(ScanType.CODE_SCAN).build();
/* test */
assertNotNull(configuration);
assertTrue(configuration.getUnmodifiableSetOfAcceptedReferenceNames().isEmpty());
assertTrue(configuration.isRootFolderAccepted());
}
use of com.mercedesbenz.sechub.commons.model.SecHubFileSystemConfiguration in project sechub by mercedes-benz.
the class SecHubFileStructureDataProviderBuilderTest method for_scanType_codescan_and_model_with_codescan_by_data_section_filesystem_builder_creates_a_configuration.
@Test
void for_scanType_codescan_and_model_with_codescan_by_data_section_filesystem_builder_creates_a_configuration() {
/* prepare */
SecHubConfigurationModel model = new SecHubConfigurationModel();
SecHubCodeScanConfiguration codeScan = new SecHubCodeScanConfiguration();
codeScan.getNamesOfUsedDataConfigurationObjects().add("test-ref-1");
SecHubFileSystemConfiguration fileSystemConfiguration = new SecHubFileSystemConfiguration();
fileSystemConfiguration.getFolders().add("myfolder1");
SecHubSourceDataConfiguration sourceConfig1 = new SecHubSourceDataConfiguration();
sourceConfig1.setFileSystem(fileSystemConfiguration);
sourceConfig1.setUniqueName("test-ref-1");
SecHubDataConfiguration data = new SecHubDataConfiguration();
data.getSources().add(sourceConfig1);
model.setData(data);
codeScan.setFileSystem(fileSystemConfiguration);
model.setCodeScan(codeScan);
/* execute */
SecHubFileStructureDataProvider configuration = builderToTest.setModel(model).setScanType(ScanType.CODE_SCAN).build();
/* test */
assertNotNull(configuration);
assertTrue(configuration.getUnmodifiableSetOfAcceptedReferenceNames().contains("test-ref-1"));
assertTrue(configuration.isRootFolderAccepted());
}
use of com.mercedesbenz.sechub.commons.model.SecHubFileSystemConfiguration in project sechub by mercedes-benz.
the class AbstractProductExecutor method addFileSystemParts.
private void addFileSystemParts(Set<String> paths, SecHubFileSystemContainer container) {
Optional<SecHubFileSystemConfiguration> fileSystemOpt = container.getFileSystem();
if (!fileSystemOpt.isPresent()) {
return;
}
SecHubFileSystemConfiguration fileSystem = fileSystemOpt.get();
paths.addAll(fileSystem.getFiles());
paths.addAll(fileSystem.getFolders());
}
Aggregations