■ ■ ■ ■ ■ ■
workflow/src/test/java/com/google/tsunami/workflow/DefaultScanningWorkflowTest.java
| skipped 25 lines |
26 | 26 | | import com.google.inject.Injector; |
27 | 27 | | import com.google.tsunami.common.time.testing.FakeUtcClockModule; |
28 | 28 | | import com.google.tsunami.plugin.testing.FailedPortScannerBootstrapModule; |
| 29 | + | import com.google.tsunami.plugin.testing.FailedRemoteVulnDetectorBootstrapModule; |
29 | 30 | | import com.google.tsunami.plugin.testing.FailedServiceFingerprinterBootstrapModule; |
30 | 31 | | import com.google.tsunami.plugin.testing.FailedVulnDetectorBootstrapModule; |
31 | 32 | | import com.google.tsunami.plugin.testing.FakePluginExecutionModule; |
32 | 33 | | import com.google.tsunami.plugin.testing.FakePortScanner; |
33 | 34 | | import com.google.tsunami.plugin.testing.FakePortScannerBootstrapModule; |
34 | 35 | | import com.google.tsunami.plugin.testing.FakePortScannerBootstrapModule2; |
| 36 | + | import com.google.tsunami.plugin.testing.FakeRemoteVulnDetector; |
| 37 | + | import com.google.tsunami.plugin.testing.FakeRemoteVulnDetectorBootstrapModule; |
35 | 38 | | import com.google.tsunami.plugin.testing.FakeServiceFingerprinter; |
36 | 39 | | import com.google.tsunami.plugin.testing.FakeServiceFingerprinterBootstrapModule; |
37 | 40 | | import com.google.tsunami.plugin.testing.FakeVulnDetector; |
| skipped 24 lines |
62 | 65 | | new FakePortScannerBootstrapModule2(), |
63 | 66 | | new FakeServiceFingerprinterBootstrapModule(), |
64 | 67 | | new FakeVulnDetectorBootstrapModule(), |
65 | | - | new FakeVulnDetectorBootstrapModule2()) |
| 68 | + | new FakeVulnDetectorBootstrapModule2(), |
| 69 | + | new FakeRemoteVulnDetectorBootstrapModule()) |
66 | 70 | | .injectMembers(this); |
67 | 71 | | } |
68 | 72 | | |
| skipped 15 lines |
84 | 88 | | executionTracer.getSelectedVulnDetectors().stream() |
85 | 89 | | .map(selectedVulnDetector -> selectedVulnDetector.tsunamiPlugin().getClass())) |
86 | 90 | | .containsExactlyElementsIn( |
87 | | - | ImmutableList.of(FakeVulnDetector.class, FakeVulnDetector2.class)); |
| 91 | + | ImmutableList.of( |
| 92 | + | FakeVulnDetector.class, FakeVulnDetector2.class, FakeRemoteVulnDetector.class)); |
88 | 93 | | } |
89 | 94 | | |
90 | 95 | | @Test |
| skipped 8 lines |
99 | 104 | | executionTracer.getSelectedVulnDetectors().stream() |
100 | 105 | | .map(selectedVulnDetector -> selectedVulnDetector.tsunamiPlugin().getClass())) |
101 | 106 | | .containsExactlyElementsIn( |
102 | | - | ImmutableList.of(FakeVulnDetector.class, FakeVulnDetector2.class)); |
| 107 | + | ImmutableList.of( |
| 108 | + | FakeVulnDetector.class, FakeVulnDetector2.class, FakeRemoteVulnDetector.class)); |
103 | 109 | | assertThat(scanResults.getScanFindings(0).getNetworkService().getServiceName()) |
104 | 110 | | .isEqualTo("https"); |
105 | 111 | | assertThat( |
| skipped 144 lines |
250 | 256 | | new FakePortScannerBootstrapModule(), |
251 | 257 | | new FakeServiceFingerprinterBootstrapModule(), |
252 | 258 | | new FakeVulnDetectorBootstrapModule(), |
253 | | - | new FailedVulnDetectorBootstrapModule()); |
| 259 | + | new FakeRemoteVulnDetectorBootstrapModule(), |
| 260 | + | new FailedVulnDetectorBootstrapModule(), |
| 261 | + | new FailedRemoteVulnDetectorBootstrapModule()); |
254 | 262 | | scanningWorkflow = injector.getInstance(DefaultScanningWorkflow.class); |
255 | 263 | | |
256 | 264 | | ScanResults scanResults = scanningWorkflow.run(buildScanTarget()); |
257 | 265 | | |
258 | 266 | | assertThat(scanResults.getScanStatus()).isEqualTo(ScanStatus.PARTIALLY_SUCCEEDED); |
259 | 267 | | assertThat(scanResults.getStatusMessage()) |
260 | | - | .contains("Failed plugins:\n/fake/VULN_DETECTION/FailedVulnDetector/v0.1"); |
261 | | - | assertThat(scanResults.getScanFindingsList()).hasSize(1); |
| 268 | + | .contains( |
| 269 | + | "Failed plugins:\n" |
| 270 | + | + "/fake/VULN_DETECTION/FailedVulnDetector/v0.1\n" |
| 271 | + | + "/fake/REMOTE_VULN_DETECTION/FailedRemoteVulnDetector/v0.1"); |
| 272 | + | assertThat(scanResults.getScanFindingsList()).hasSize(2); |
262 | 273 | | } |
263 | 274 | | |
264 | 275 | | @Test |
| skipped 5 lines |
270 | 281 | | new FakePluginExecutionModule(), |
271 | 282 | | new FakePortScannerBootstrapModule(), |
272 | 283 | | new FakeServiceFingerprinterBootstrapModule(), |
273 | | - | new FailedVulnDetectorBootstrapModule()); |
| 284 | + | new FailedVulnDetectorBootstrapModule(), |
| 285 | + | new FailedRemoteVulnDetectorBootstrapModule()); |
274 | 286 | | scanningWorkflow = injector.getInstance(DefaultScanningWorkflow.class); |
275 | 287 | | |
276 | 288 | | ScanResults scanResults = scanningWorkflow.run(buildScanTarget()); |
| skipped 30 lines |