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