Search in sources :

Example 1 with NessusAdapter

use of com.mercedesbenz.sechub.adapter.nessus.NessusAdapter in project sechub by mercedes-benz.

the class NessusProductExecutorTest method before.

@Before
public void before() throws Exception {
    context = mock(SecHubExecutionContext.class);
    config = mock(SecHubConfiguration.class);
    target1 = new Target(URI_1, TargetType.INTERNET);
    target2 = new Target(URI_2, TargetType.INTERNET);
    target3 = new Target(URI_3, TargetType.INTERNET);
    targetResolver = mock(TargetResolver.class);
    when(targetResolver.resolveTarget(URI_1)).thenReturn(target1);
    when(targetResolver.resolveTarget(URI_2)).thenReturn(target2);
    when(targetResolver.resolveTarget(URI_3)).thenReturn(target3);
    nessusAdapter = mock(NessusAdapter.class);
    executorContext = mock(ProductExecutorContext.class);
    executorConfig = mock(ProductExecutorConfig.class);
    ProductResult productResult = mock(ProductResult.class);
    when(executorContext.getExecutorConfig()).thenReturn(executorConfig);
    when(executorContext.getCurrentProductResult()).thenReturn(productResult);
    installSetup = mock(NessusInstallSetup.class);
    when(installSetup.getBaseURL(any())).thenReturn("baseURL");
    when(installSetup.getUserId(any())).thenReturn("user");
    when(installSetup.getPassword(any())).thenReturn("password");
    when(installSetup.isAbleToScan(TargetType.INTRANET)).thenReturn(false);
    when(context.getConfiguration()).thenReturn(config);
    when(context.getSechubJobUUID()).thenReturn(UUID.randomUUID());
    executorToTest = new TestNessusProductExecutor();
    executorToTest.installSetup = installSetup;
    executorToTest.nessusAdapter = nessusAdapter;
}
Also used : Target(com.mercedesbenz.sechub.domain.scan.Target) ProductResult(com.mercedesbenz.sechub.domain.scan.product.ProductResult) NessusAdapter(com.mercedesbenz.sechub.adapter.nessus.NessusAdapter) SecHubExecutionContext(com.mercedesbenz.sechub.sharedkernel.execution.SecHubExecutionContext) SecHubConfiguration(com.mercedesbenz.sechub.sharedkernel.configuration.SecHubConfiguration) ProductExecutorContext(com.mercedesbenz.sechub.domain.scan.product.ProductExecutorContext) ProductExecutorConfig(com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfig) TargetResolver(com.mercedesbenz.sechub.domain.scan.resolve.TargetResolver) Before(org.junit.Before)

Aggregations

NessusAdapter (com.mercedesbenz.sechub.adapter.nessus.NessusAdapter)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 ProductExecutorConfig (com.mercedesbenz.sechub.domain.scan.product.config.ProductExecutorConfig)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 Before (org.junit.Before)1