Search in sources :

Example 1 with SecHubDataConfiguration

use of com.mercedesbenz.sechub.commons.model.SecHubDataConfiguration 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());
}
Also used : SecHubSourceDataConfiguration(com.mercedesbenz.sechub.commons.model.SecHubSourceDataConfiguration) SecHubConfigurationModel(com.mercedesbenz.sechub.commons.model.SecHubConfigurationModel) SecHubCodeScanConfiguration(com.mercedesbenz.sechub.commons.model.SecHubCodeScanConfiguration) SecHubFileSystemConfiguration(com.mercedesbenz.sechub.commons.model.SecHubFileSystemConfiguration) SecHubDataConfiguration(com.mercedesbenz.sechub.commons.model.SecHubDataConfiguration) Test(org.junit.jupiter.api.Test)

Aggregations

SecHubCodeScanConfiguration (com.mercedesbenz.sechub.commons.model.SecHubCodeScanConfiguration)1 SecHubConfigurationModel (com.mercedesbenz.sechub.commons.model.SecHubConfigurationModel)1 SecHubDataConfiguration (com.mercedesbenz.sechub.commons.model.SecHubDataConfiguration)1 SecHubFileSystemConfiguration (com.mercedesbenz.sechub.commons.model.SecHubFileSystemConfiguration)1 SecHubSourceDataConfiguration (com.mercedesbenz.sechub.commons.model.SecHubSourceDataConfiguration)1 Test (org.junit.jupiter.api.Test)1