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;
}
Aggregations