use of com.checkmarx.flow.exception.MachinaException in project cx-flow by checkmarx-ltd.
the class CxConfigSteps method processScanResultsInCxFlow.
private void processScanResultsInCxFlow() throws InterruptedException {
try {
ScanRequest scanRequest = createScanRequest();
CompletableFuture<ScanResults> task = resultsService.processScanResultsAsync(scanRequest, 0, 0, null, null);
task.get(1, TimeUnit.MINUTES);
} catch (MachinaException | ExecutionException | TimeoutException e) {
String message = "Error processing scan results.";
log.error(message, e);
Assert.fail(message);
}
}
use of com.checkmarx.flow.exception.MachinaException in project cx-flow by checkmarx-ltd.
the class SarifIssueTrackerTest method completeWithParameters.
@Test
public void completeWithParameters() {
SarifIssueTracker issueTracker = getInstance();
try {
ScanRequest request = getRequest();
ScanResults results = getResults();
request.setFilename("./sarif-result.json");
issueTracker.complete(request, results);
assert true;
} catch (MachinaException e) {
assert false;
}
}
use of com.checkmarx.flow.exception.MachinaException in project cx-flow by checkmarx-ltd.
the class ServiceNowTrackerTest method searchAndCloseIssues_WithAllParams_Success.
@Test
public void searchAndCloseIssues_WithAllParams_Success() {
try {
log.info("Start searchAndCloseIssues_WithAllParams_Success");
// find an existing issue
ScanRequest request = getRequest();
List<Issue> issues = issueTracker.getIssues(request);
assertNotNull(issues);
assertTrue(issues.size() > 0);
assertNotNull(issues.get(0).getId());
request.setId(issues.get(0).getId());
// close an existing issue
issueTracker.closeIssue(issues.get(0), request);
// check closed issue
issues = issueTracker.getIssues(request);
assertNotNull(issues);
assertTrue(issues.size() > 0);
assertTrue(issues.get(0).getState().equals("7"));
} catch (MachinaException e) {
log.error(e.getMessage());
}
}
use of com.checkmarx.flow.exception.MachinaException in project cx-flow by checkmarx-ltd.
the class ServiceNowTrackerTest method searchAndUpdateIssues_WithAllParams_Success.
@Test
public void searchAndUpdateIssues_WithAllParams_Success() {
try {
log.info("Start searchAndUpdateIssues_WithAllParams_Success");
// find an existing issue
ScanRequest request = getRequest();
List<Issue> issues = issueTracker.getIssues(request);
assertNotNull(issues);
assertTrue(issues.size() > 0);
assertNotNull(issues.get(0).getId());
ScanResults.XIssue resultIssue = getIssue("update test incident");
request.setId(issues.get(0).getId());
// update existing issue
Issue upatedIssue = issueTracker.updateIssue(issues.get(0), resultIssue, request);
assertNotNull(upatedIssue);
} catch (MachinaException e) {
log.error(e.getMessage());
}
}
use of com.checkmarx.flow.exception.MachinaException in project cx-flow by checkmarx-ltd.
the class ServiceNowTrackerTest method createAndSearchIssues_WithAllParams_Success.
@Test
public void createAndSearchIssues_WithAllParams_Success() {
try {
log.info("Start createAndSearchIssues_WithAllParams_Success");
ScanResults.XIssue issue = getIssue("create test incident");
ScanRequest request = getRequest();
issueTracker.init(request, null);
Issue newIssue = issueTracker.createIssue(issue, request);
assertNotNull(newIssue);
} catch (MachinaException e) {
log.error(e.getMessage());
}
}
Aggregations