Search in sources :

Example 26 with SecHubWebScanConfiguration

use of com.mercedesbenz.sechub.commons.model.SecHubWebScanConfiguration in project sechub by mercedes-benz.

the class NetsparkerProductExecutorTest method prepareWebScanWithOneInternetURI.

private void prepareWebScanWithOneInternetURI() throws URISyntaxException, SecHubExecutionException {
    SecHubWebScanConfiguration webscan = mock(SecHubWebScanConfiguration.class);
    when(config.getWebScan()).thenReturn(Optional.of(webscan));
    URI uri = URI_1_INTERNET;
    when(webscan.getUri()).thenReturn(uri);
}
Also used : SecHubWebScanConfiguration(com.mercedesbenz.sechub.commons.model.SecHubWebScanConfiguration) URI(java.net.URI)

Example 27 with SecHubWebScanConfiguration

use of com.mercedesbenz.sechub.commons.model.SecHubWebScanConfiguration in project sechub by mercedes-benz.

the class SecHubConfigurationValidatorTest method webconfig_with_uri_as_https_is_NOT_rejected.

@Test
public void webconfig_with_uri_as_https_is_NOT_rejected() throws Exception {
    /* prepare */
    SecHubWebScanConfiguration webscan = mock(SecHubWebScanConfiguration.class);
    URI uri = URI.create("https://www.example.com");
    when(webscan.getUri()).thenReturn(uri);
    when(target.getWebScan()).thenReturn(Optional.of(webscan));
    /* execute */
    validatorToTest.validate(target, errors);
    assertNoIllegalSchemaError();
}
Also used : SecHubWebScanConfiguration(com.mercedesbenz.sechub.commons.model.SecHubWebScanConfiguration) URI(java.net.URI) Test(org.junit.Test)

Example 28 with SecHubWebScanConfiguration

use of com.mercedesbenz.sechub.commons.model.SecHubWebScanConfiguration in project sechub by mercedes-benz.

the class SecHubConfigurationValidatorTest method webconfig_with_uri_as_http_is_NOT_rejected.

@Test
public void webconfig_with_uri_as_http_is_NOT_rejected() throws Exception {
    /* prepare */
    SecHubWebScanConfiguration webscan = mock(SecHubWebScanConfiguration.class);
    URI uri = URI.create("http://www.example.com");
    when(webscan.getUri()).thenReturn(uri);
    when(target.getWebScan()).thenReturn(Optional.of(webscan));
    /* execute */
    validatorToTest.validate(target, errors);
    assertNoIllegalSchemaError();
}
Also used : SecHubWebScanConfiguration(com.mercedesbenz.sechub.commons.model.SecHubWebScanConfiguration) URI(java.net.URI) Test(org.junit.Test)

Aggregations

SecHubWebScanConfiguration (com.mercedesbenz.sechub.commons.model.SecHubWebScanConfiguration)28 URI (java.net.URI)11 Test (org.junit.Test)11 BasicLoginConfiguration (com.mercedesbenz.sechub.commons.model.login.BasicLoginConfiguration)7 WebLoginConfiguration (com.mercedesbenz.sechub.commons.model.login.WebLoginConfiguration)7 FormLoginConfiguration (com.mercedesbenz.sechub.commons.model.login.FormLoginConfiguration)6 URL (java.net.URL)6 Test (org.junit.jupiter.api.Test)6 LinkedList (java.util.LinkedList)5 List (java.util.List)5 Action (com.mercedesbenz.sechub.commons.model.login.Action)4 Script (com.mercedesbenz.sechub.commons.model.login.Script)4 AuthenticationType (com.mercedesbenz.sechub.owaspzapwrapper.config.auth.AuthenticationType)4 SecHubScanConfiguration (com.mercedesbenz.sechub.commons.model.SecHubScanConfiguration)3 CommandLineSettings (com.mercedesbenz.sechub.owaspzapwrapper.cli.CommandLineSettings)3 File (java.io.File)3 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 MustExitRuntimeException (com.mercedesbenz.sechub.owaspzapwrapper.cli.MustExitRuntimeException)2 TextFileReader (com.mercedesbenz.sechub.commons.TextFileReader)1 SecHubInfrastructureScanConfiguration (com.mercedesbenz.sechub.commons.model.SecHubInfrastructureScanConfiguration)1