Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 327647369
Change-Id: I41833de0103fa86a755cf5e2280d8be94360fbda
  • Loading branch information
Tsunami Team authored and copybara-github committed Aug 20, 2020
1 parent c157f24 commit 514d7d1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package com.google.tsunami.plugin.testing;

import static com.google.common.collect.ImmutableList.toImmutableList;

import com.google.common.collect.ImmutableList;
import com.google.protobuf.util.Timestamps;
import com.google.tsunami.plugin.PluginType;
Expand Down Expand Up @@ -61,8 +63,8 @@ public DetectionReportList detect(
return DetectionReportList.newBuilder()
.addAllDetectionReports(
matchedServices.stream()
.map(networkService -> getFakeDetectionReport(targetInfo, networkService))
::iterator)
.map(networkService -> getFakeDetectionReport(targetInfo, networkService))
.collect(toImmutableList()))
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package com.google.tsunami.plugin.testing;

import static com.google.common.collect.ImmutableList.toImmutableList;

import com.google.common.collect.ImmutableList;
import com.google.protobuf.util.Timestamps;
import com.google.tsunami.plugin.PluginType;
Expand Down Expand Up @@ -61,8 +63,8 @@ public DetectionReportList detect(
return DetectionReportList.newBuilder()
.addAllDetectionReports(
matchedServices.stream()
.map(networkService -> getFakeDetectionReport(targetInfo, networkService))
::iterator)
.map(networkService -> getFakeDetectionReport(targetInfo, networkService))
.collect(toImmutableList()))
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -305,22 +305,22 @@ private ScanResults generateScanResults(
.setStatusMessage(statusMessage)
.addAllScanFindings(
succeededDetectionReports.stream()
.filter(
detectionReport ->
detectionReport
.getDetectionStatus()
.equals(DetectionStatus.VULNERABILITY_VERIFIED)
|| detectionReport
.getDetectionStatus()
.equals(DetectionStatus.VULNERABILITY_PRESENT))
.map(
detectionReport ->
ScanFinding.newBuilder()
.setTargetInfo(detectionReport.getTargetInfo())
.setNetworkService(detectionReport.getNetworkService())
.setVulnerability(detectionReport.getVulnerability())
.build())
::iterator)
.filter(
detectionReport ->
detectionReport
.getDetectionStatus()
.equals(DetectionStatus.VULNERABILITY_VERIFIED)
|| detectionReport
.getDetectionStatus()
.equals(DetectionStatus.VULNERABILITY_PRESENT))
.map(
detectionReport ->
ScanFinding.newBuilder()
.setTargetInfo(detectionReport.getTargetInfo())
.setNetworkService(detectionReport.getNetworkService())
.setVulnerability(detectionReport.getVulnerability())
.build())
.collect(toImmutableList()))
.setScanStartTimestamp(Timestamps.fromMillis(scanStartTimestamp.toEpochMilli()))
.setScanDuration(
Durations.fromMillis(
Expand Down

0 comments on commit 514d7d1

Please sign in to comment.