diff --git a/apps/dashboard/src/main/java/com/akto/action/testing/StartTestAction.java b/apps/dashboard/src/main/java/com/akto/action/testing/StartTestAction.java index ff71d0f67c..a975ad40b1 100644 --- a/apps/dashboard/src/main/java/com/akto/action/testing/StartTestAction.java +++ b/apps/dashboard/src/main/java/com/akto/action/testing/StartTestAction.java @@ -722,46 +722,46 @@ public String fetchVulnerableTestRunResults() { ); List testingRunResultList = TestingRunResultDao.instance.findAll(filters, skip, 50, null); - Map sampleDataVsCurlMap = new HashMap<>(); - for (TestingRunResult runResult: testingRunResultList) { - WorkflowTest workflowTest = runResult.getWorkflowTest(); - for (GenericTestResult tr : runResult.getTestResults()) { - if (tr.isVulnerable()) { - if (tr instanceof TestResult) { - TestResult testResult = (TestResult) tr; - sampleDataVsCurlMap.put(testResult.getMessage(), - ExportSampleDataAction.getCurl(testResult.getMessage())); - sampleDataVsCurlMap.put(testResult.getOriginalMessage(), - ExportSampleDataAction.getCurl(testResult.getOriginalMessage())); - } else if (tr instanceof MultiExecTestResult){ - MultiExecTestResult testResult = (MultiExecTestResult) tr; - Map nodeResultMap = testResult.getNodeResultMap(); - for (String order : nodeResultMap.keySet()) { - WorkflowTestResult.NodeResult nodeResult = nodeResultMap.get(order); - String nodeResultLastMessage = getNodeResultLastMessage(nodeResult.getMessage()); - if (nodeResultLastMessage != null) { - nodeResult.setMessage(nodeResultLastMessage); - sampleDataVsCurlMap.put(nodeResultLastMessage, - ExportSampleDataAction.getCurl(nodeResultLastMessage)); - } - } - } - } - } - if (workflowTest != null) { - Map nodeDetailsMap = workflowTest.getMapNodeIdToWorkflowNodeDetails(); - for (String nodeName: nodeDetailsMap.keySet()) { - if (nodeDetailsMap.get(nodeName) instanceof YamlNodeDetails) { - YamlNodeDetails details = (YamlNodeDetails) nodeDetailsMap.get(nodeName); - sampleDataVsCurlMap.put(details.getOriginalMessage(), - ExportSampleDataAction.getCurl(details.getOriginalMessage())); - } - - } - } - } + // Map sampleDataVsCurlMap = new HashMap<>(); + // for (TestingRunResult runResult: testingRunResultList) { + // WorkflowTest workflowTest = runResult.getWorkflowTest(); + // for (GenericTestResult tr : runResult.getTestResults()) { + // if (tr.isVulnerable()) { + // if (tr instanceof TestResult) { + // TestResult testResult = (TestResult) tr; + // // sampleDataVsCurlMap.put(testResult.getMessage(), + // // ExportSampleDataAction.getCurl(testResult.getMessage())); + // // sampleDataVsCurlMap.put(testResult.getOriginalMessage(), + // // ExportSampleDataAction.getCurl(testResult.getOriginalMessage())); + // } else if (tr instanceof MultiExecTestResult){ + // MultiExecTestResult testResult = (MultiExecTestResult) tr; + // Map nodeResultMap = testResult.getNodeResultMap(); + // for (String order : nodeResultMap.keySet()) { + // WorkflowTestResult.NodeResult nodeResult = nodeResultMap.get(order); + // String nodeResultLastMessage = getNodeResultLastMessage(nodeResult.getMessage()); + // if (nodeResultLastMessage != null) { + // nodeResult.setMessage(nodeResultLastMessage); + // sampleDataVsCurlMap.put(nodeResultLastMessage, + // ExportSampleDataAction.getCurl(nodeResultLastMessage)); + // } + // } + // } + // } + // } + // if (workflowTest != null) { + // Map nodeDetailsMap = workflowTest.getMapNodeIdToWorkflowNodeDetails(); + // for (String nodeName: nodeDetailsMap.keySet()) { + // if (nodeDetailsMap.get(nodeName) instanceof YamlNodeDetails) { + // YamlNodeDetails details = (YamlNodeDetails) nodeDetailsMap.get(nodeName); + // sampleDataVsCurlMap.put(details.getOriginalMessage(), + // ExportSampleDataAction.getCurl(details.getOriginalMessage())); + // } + + // } + // } + // } this.testingRunResults = testingRunResultList; - this.sampleDataVsCurlMap = sampleDataVsCurlMap; + // this.sampleDataVsCurlMap = sampleDataVsCurlMap; } catch (Exception e) { loggerMaker.errorAndAddToDb("Error while executing test run summary" + e.getMessage(), LogDb.DASHBOARD); addActionError("Invalid test summary id"); diff --git a/apps/dashboard/src/main/java/com/akto/action/testing_issues/IssuesAction.java b/apps/dashboard/src/main/java/com/akto/action/testing_issues/IssuesAction.java index cd9aa6f8fb..7f4e07a8ad 100644 --- a/apps/dashboard/src/main/java/com/akto/action/testing_issues/IssuesAction.java +++ b/apps/dashboard/src/main/java/com/akto/action/testing_issues/IssuesAction.java @@ -324,7 +324,7 @@ public String fetchVulnerableTestingRunResultsFromIssues() { } if (issues.isEmpty()) { this.testingRunResults = new ArrayList<>(); - this.sampleDataVsCurlMap = new HashMap<>(); + // this.sampleDataVsCurlMap = new HashMap<>(); return SUCCESS.toUpperCase(); } Bson orFilters = Filters.or(andFilters); @@ -333,14 +333,14 @@ public String fetchVulnerableTestingRunResultsFromIssues() { // todo: fix for (TestingRunResult runResult: this.testingRunResults) { List testResults = new ArrayList<>(); - WorkflowTest workflowTest = runResult.getWorkflowTest(); + // WorkflowTest workflowTest = runResult.getWorkflowTest(); for (GenericTestResult tr : runResult.getTestResults()) { if (tr.isVulnerable()) { if (tr instanceof TestResult) { TestResult testResult = (TestResult) tr; testResults.add(testResult); - sampleDataVsCurlMap.put(testResult.getMessage(), ExportSampleDataAction.getCurl(testResult.getMessage())); - sampleDataVsCurlMap.put(testResult.getOriginalMessage(), ExportSampleDataAction.getCurl(testResult.getOriginalMessage())); + // sampleDataVsCurlMap.put(testResult.getMessage(), ExportSampleDataAction.getCurl(testResult.getMessage())); + // sampleDataVsCurlMap.put(testResult.getOriginalMessage(), ExportSampleDataAction.getCurl(testResult.getOriginalMessage())); } else if (tr instanceof MultiExecTestResult){ MultiExecTestResult testResult = (MultiExecTestResult) tr; testResults.add(testResult); @@ -350,27 +350,27 @@ public String fetchVulnerableTestingRunResultsFromIssues() { String nodeResultLastMessage = StartTestAction.getNodeResultLastMessage(nodeResult.getMessage()); if (nodeResultLastMessage != null) { nodeResult.setMessage(nodeResultLastMessage); - sampleDataVsCurlMap.put(nodeResultLastMessage, - ExportSampleDataAction.getCurl(nodeResultLastMessage)); + // sampleDataVsCurlMap.put(nodeResultLastMessage, + // ExportSampleDataAction.getCurl(nodeResultLastMessage)); } } } } - if (workflowTest != null) { - Map nodeDetailsMap = workflowTest.getMapNodeIdToWorkflowNodeDetails(); - for (String nodeName: nodeDetailsMap.keySet()) { - if (nodeDetailsMap.get(nodeName) instanceof YamlNodeDetails) { - YamlNodeDetails details = (YamlNodeDetails) nodeDetailsMap.get(nodeName); - sampleDataVsCurlMap.put(details.getOriginalMessage(), - ExportSampleDataAction.getCurl(details.getOriginalMessage())); - } - - } - } + // if (workflowTest != null) { + // Map nodeDetailsMap = workflowTest.getMapNodeIdToWorkflowNodeDetails(); + // for (String nodeName: nodeDetailsMap.keySet()) { + // if (nodeDetailsMap.get(nodeName) instanceof YamlNodeDetails) { + // YamlNodeDetails details = (YamlNodeDetails) nodeDetailsMap.get(nodeName); + // sampleDataVsCurlMap.put(details.getOriginalMessage(), + // ExportSampleDataAction.getCurl(details.getOriginalMessage())); + // } + + // } + // } } runResult.setTestResults(testResults); } - this.sampleDataVsCurlMap = sampleDataVsCurlMap; + // this.sampleDataVsCurlMap = sampleDataVsCurlMap; } catch (Exception e) { return ERROR.toUpperCase(); }