use of com.mercedesbenz.sechub.sharedkernel.configuration.SecHubConfiguration in project sechub by mercedes-benz.
the class PDSInfraScanProductExecutor method customize.
@Override
protected void customize(ProductExecutorData data) {
SecHubConfiguration secHubConfiguration = data.getSechubExecutionContext().getConfiguration();
data.setNetworkLocationProvider(new InfraScanNetworkLocationProvider(secHubConfiguration));
ProductExecutorContext executorContext = data.getProductExecutorContext();
PDSExecutorConfigSuppport configSupport = PDSExecutorConfigSuppport.createSupportAndAssertConfigValid(executorContext.getExecutorConfig(), systemEnvironment);
data.setNetworkTargetDataProvider(configSupport);
}
use of com.mercedesbenz.sechub.sharedkernel.configuration.SecHubConfiguration in project sechub by mercedes-benz.
the class WebConfigBuilderStrategyTest method includes_no_slash_infront_multiple.
@Test
public void includes_no_slash_infront_multiple() {
/* prepare */
List<String> includes = new LinkedList<>();
includes.add("/abc");
includes.add("contact.html");
includes.add("/hidden");
includes.add("ccb/bca");
String json = createIncludesJson(includes);
SecHubConfiguration configuration = SECHUB_CONFIG.fromJSON(json);
SecHubExecutionContext context = new SecHubExecutionContext(UUID.randomUUID(), configuration, "test");
WebConfigBuilderStrategy strategyToTest = new WebConfigBuilderStrategy(context);
TestAbstractWebScanAdapterConfigBuilder configBuilder = new TestAbstractWebScanAdapterConfigBuilder();
/* execute */
IllegalArgumentException exception = Assertions.assertThrows(IllegalArgumentException.class, () -> {
strategyToTest.configure(configBuilder);
});
/* test */
assertEquals("The URL does not start with a slash '/'. URL: contact.html", exception.getMessage());
}
use of com.mercedesbenz.sechub.sharedkernel.configuration.SecHubConfiguration in project sechub by mercedes-benz.
the class WebConfigBuilderStrategyTest method includes_no_slash_infront_single.
@Test
public void includes_no_slash_infront_single() {
/* prepare */
List<String> includes = new LinkedList<>();
includes.add("contact.html");
String json = createIncludesJson(includes);
SecHubConfiguration configuration = SECHUB_CONFIG.fromJSON(json);
SecHubExecutionContext context = new SecHubExecutionContext(UUID.randomUUID(), configuration, "test");
WebConfigBuilderStrategy strategyToTest = new WebConfigBuilderStrategy(context);
TestAbstractWebScanAdapterConfigBuilder configBuilder = new TestAbstractWebScanAdapterConfigBuilder();
/* execute */
IllegalArgumentException exception = Assertions.assertThrows(IllegalArgumentException.class, () -> {
strategyToTest.configure(configBuilder);
});
/* test */
assertEquals("The URL does not start with a slash '/'. URL: contact.html", exception.getMessage());
}
use of com.mercedesbenz.sechub.sharedkernel.configuration.SecHubConfiguration in project sechub by mercedes-benz.
the class WebConfigBuilderStrategyTest method excludes_no_slash_infront_single.
@Test
public void excludes_no_slash_infront_single() {
/* prepare */
List<String> excludes = new LinkedList<>();
excludes.add("contact.html");
String json = createExcludesJson(excludes);
SecHubConfiguration configuration = SECHUB_CONFIG.fromJSON(json);
SecHubExecutionContext context = new SecHubExecutionContext(UUID.randomUUID(), configuration, "test");
WebConfigBuilderStrategy strategyToTest = new WebConfigBuilderStrategy(context);
TestAbstractWebScanAdapterConfigBuilder configBuilder = new TestAbstractWebScanAdapterConfigBuilder();
/* execute */
IllegalArgumentException exception = Assertions.assertThrows(IllegalArgumentException.class, () -> {
strategyToTest.configure(configBuilder);
});
/* test */
assertEquals("The URL does not start with a slash '/'. URL: contact.html", exception.getMessage());
}
use of com.mercedesbenz.sechub.sharedkernel.configuration.SecHubConfiguration in project sechub by mercedes-benz.
the class WebConfigBuilderStrategyTest method createContext.
private SecHubExecutionContext createContext(String pathToTestConfig) {
String json = ScanDomainTestFileSupport.getTestfileSupport().loadTestFile(pathToTestConfig);
SecHubConfiguration configuration = SECHUB_CONFIG.fromJSON(json);
return new SecHubExecutionContext(UUID.randomUUID(), configuration, "test");
}
Aggregations