use of com.mercedesbenz.sechub.domain.scan.product.WebScanProductExecutionService in project sechub by mercedes-benz.
the class ScanServiceTest method before.
@Before
public void before() throws Exception {
storageService = mock(StorageService.class);
jobStorage = mock(JobStorage.class);
scanProjectConfigService = mock(ScanProjectConfigService.class);
scanJobRegistry = mock(ScanJobListener.class);
monitorFactory = mock(ScanProgressMonitorFactory.class);
ProgressMonitor monitor = mock(ProgressMonitor.class);
when(monitor.getId()).thenReturn("monitor-test-id");
when(storageService.getJobStorage(any(), any())).thenReturn(jobStorage);
when(monitorFactory.createProgressMonitor(any())).thenReturn(monitor);
webScanProductExecutionService = mock(WebScanProductExecutionService.class);
codeScanProductExecutionService = mock(CodeScanProductExecutionService.class);
infrastructureScanProductExecutionService = mock(InfrastructureScanProductExecutionService.class);
scanLogService = mock(ProjectScanLogService.class);
reportService = mock(CreateScanReportService.class);
report = mock(ScanReport.class);
when(report.getTrafficLightAsString()).thenReturn(TRAFFIC_LIGHT);
when(reportService.createReport(any())).thenReturn(report);
serviceToTest = new ScanService();
serviceToTest.webScanProductExecutionService = webScanProductExecutionService;
serviceToTest.infraScanProductExecutionService = infrastructureScanProductExecutionService;
serviceToTest.codeScanProductExecutionService = codeScanProductExecutionService;
serviceToTest.reportService = reportService;
serviceToTest.storageService = storageService;
serviceToTest.scanLogService = scanLogService;
serviceToTest.scanProjectConfigService = scanProjectConfigService;
serviceToTest.scanJobListener = scanJobRegistry;
serviceToTest.monitorFactory = monitorFactory;
}
Aggregations