use of com.checkmarx.flow.dto.BugTrackersDto in project cx-flow by checkmarx-ltd.
the class DeleteBranchSteps method initServices.
private void initServices() {
CxScannerService cxScannerService = new CxScannerService(cxProperties, null, flowProperties, cxClientMock, null);
ProjectNameGenerator projectNameGeneratorSpy = spy(new ProjectNameGenerator(helperService, cxScannerService, flowProperties));
initProjectNameGeneratorSpy(projectNameGeneratorSpy);
ScanRequestConverter scanRequestConverter = new ScanRequestConverter(helperService, flowProperties, gitHubService, null, null, null, null, cxClientMock, cxProperties);
SastScanner sastScanner = new SastScanner(null, cxProperties, flowProperties, null, projectNameGeneratorSpy, cxClientMock, new BugTrackersDto(emailService, bugTrackerEventTrigger, gitHubService, null, null, null, null));
List<VulnerabilityScanner> scanners = new LinkedList<>();
scanners.add(sastScanner);
FlowService flowServiceSpy = spy(new FlowService(scanners, projectNameGeneratorSpy, resultsServiceMock));
// gitHubControllerSpy is a spy which will run real methods.
// It will connect to a real github repository to read a real cx.config file
// And thus it will work with real gitHubService
this.gitHubControllerSpy = spy(new GitHubController(gitHubProperties, flowProperties, null, flowServiceSpy, helperService, gitHubService, gitHubAppAuthService, filterFactory, configOverrider, null, gitAuthUrlGenerator));
this.adoControllerSpy = spy(new ADOController(adoProperties, flowProperties, null, flowServiceSpy, helperService, filterFactory, configOverrider, adoServiceMock, scmConfigOverrider, gitAuthUrlGenerator));
}
use of com.checkmarx.flow.dto.BugTrackersDto in project cx-flow by checkmarx-ltd.
the class PublishingSteps method initCxClientMock.
private void initCxClientMock() throws CheckmarxException {
sastScanner = mock(SastScanner.class, Mockito.withSettings().useConstructor(resultsService, cxProperties, flowProperties, null, projectNameGenerator, cxClientMock, new BugTrackersDto(null, null, null, null, null, null, null)));
scanResultsToInject = new ScanResultsBuilder().getScanResultsWithSingleFinding(getProjectName());
when(sastScanner.isEnabled()).thenReturn(true);
when(sastScanner.scan(any())).thenReturn(scanResultsToInject);
// Prevent an error related to scan resubmission.
when(cxClientMock.getScanIdOfExistingScanIfExists(any())).thenReturn(Constants.UNKNOWN_INT);
}
Aggregations