Search in sources :

Example 1 with NetsparkerAdapter

use of com.mercedesbenz.sechub.adapter.netsparker.NetsparkerAdapter in project sechub by mercedes-benz.

the class NetsparkerProductExecutorTest method before.

@Before
public void before() throws Exception {
    context = mock(SecHubExecutionContext.class);
    config = mock(SecHubConfiguration.class);
    executorContext = mock(ProductExecutorContext.class);
    target1 = new Target(URI_1_INTERNET, TargetType.INTERNET);
    target2 = new Target(URI_2_INTERNET, TargetType.INTERNET);
    target3 = new Target(URI_3_INTERNET, TargetType.INTERNET);
    targetResolver = mock(TargetResolver.class);
    when(targetResolver.resolveTarget(URI_1_INTERNET)).thenReturn(target1);
    when(targetResolver.resolveTarget(URI_2_INTERNET)).thenReturn(target2);
    when(targetResolver.resolveTarget(URI_3_INTERNET)).thenReturn(target3);
    netsparkerAdapter = mock(NetsparkerAdapter.class);
    when(context.getConfiguration()).thenReturn(config);
    UUID pseudoJobUUID = UUID.randomUUID();
    when(context.getSechubJobUUID()).thenReturn(pseudoJobUUID);
    when(executorContext.getCurrentProductResult()).thenReturn(new ProductResult(pseudoJobUUID, "project1", new WithoutProductExecutorConfigInfo(ProductIdentifier.NETSPARKER), "resullt1"));
    executorToTest = new TestNetsparkerProductExecutor();
    executorToTest.netsparkerAdapter = netsparkerAdapter;
    installSetup = mock(NetsparkerInstallSetup.class);
    when(installSetup.getBaseURL()).thenReturn("http://www.example.com/netsparker");
    when(installSetup.getUserId()).thenReturn("user");
    when(installSetup.getPassword()).thenReturn("apitoken1");
    when(installSetup.getNetsparkerLicenseId()).thenReturn("license1");
    executorToTest.installSetup = installSetup;
}
Also used : NetsparkerAdapter(com.mercedesbenz.sechub.adapter.netsparker.NetsparkerAdapter) Target(com.mercedesbenz.sechub.domain.scan.Target) ProductResult(com.mercedesbenz.sechub.domain.scan.product.ProductResult) SecHubExecutionContext(com.mercedesbenz.sechub.sharedkernel.execution.SecHubExecutionContext) SecHubConfiguration(com.mercedesbenz.sechub.sharedkernel.configuration.SecHubConfiguration) ProductExecutorContext(com.mercedesbenz.sechub.domain.scan.product.ProductExecutorContext) UUID(java.util.UUID) TargetResolver(com.mercedesbenz.sechub.domain.scan.resolve.TargetResolver) WithoutProductExecutorConfigInfo(com.mercedesbenz.sechub.domain.scan.product.config.WithoutProductExecutorConfigInfo) Before(org.junit.Before)

Aggregations

NetsparkerAdapter (com.mercedesbenz.sechub.adapter.netsparker.NetsparkerAdapter)1 Target (com.mercedesbenz.sechub.domain.scan.Target)1 ProductExecutorContext (com.mercedesbenz.sechub.domain.scan.product.ProductExecutorContext)1 ProductResult (com.mercedesbenz.sechub.domain.scan.product.ProductResult)1 WithoutProductExecutorConfigInfo (com.mercedesbenz.sechub.domain.scan.product.config.WithoutProductExecutorConfigInfo)1 TargetResolver (com.mercedesbenz.sechub.domain.scan.resolve.TargetResolver)1 SecHubConfiguration (com.mercedesbenz.sechub.sharedkernel.configuration.SecHubConfiguration)1 SecHubExecutionContext (com.mercedesbenz.sechub.sharedkernel.execution.SecHubExecutionContext)1 UUID (java.util.UUID)1 Before (org.junit.Before)1