File tree Expand file tree Collapse file tree
main/java/org/parosproxy/paros/core/scanner
test/java/org/parosproxy/paros/core/scanner Expand file tree Collapse file tree Original file line number Diff line number Diff line change 106106// ZAP: 2022/09/21 Use format specifiers instead of concatenation when logging.
107107// ZAP: 2023/01/10 Tidy up logger.
108108// ZAP: 2023/05/17 Skip rules that reach the maximum number of alerts.
109+ // ZAP: 2026/05/28 From now on we will not be recording changes here as the files have changed so
110+ // much.
109111package org .parosproxy .paros .core .scanner ;
110112
111113import java .io .IOException ;
112114import java .text .DecimalFormat ;
113115import java .util .ArrayList ;
116+ import java .util .Collections ;
114117import java .util .HashMap ;
115118import java .util .HashSet ;
116119import java .util .Iterator ;
@@ -330,6 +333,16 @@ public void addStartNode(StructuralNode startNode) {
330333 this .startNodes .add (startNode );
331334 }
332335
336+ /**
337+ * Gets the start nodes.
338+ *
339+ * @return the start nodes
340+ * @since 2.18.0
341+ */
342+ public List <StructuralNode > getStartNodes () {
343+ return Collections .unmodifiableList (this .startNodes );
344+ }
345+
333346 /** Stop the current scanning process */
334347 public void stop () {
335348 isStop = true ;
Original file line number Diff line number Diff line change @@ -224,6 +224,10 @@ void shouldScanStartNodeSet() {
224224 hostProcess .run ();
225225 // Then
226226 assertThat (hostProcess .getTestTotalCount (), is (equalTo (1 )));
227+ assertThat (hostProcess .getStartNodes ().size (), is (1 ));
228+ assertThat (
229+ hostProcess .getStartNodes ().get (0 ).getURI ().toString (),
230+ is ("http://localhost/file" ));
227231 }
228232
229233 @ Test
@@ -237,6 +241,13 @@ void shouldScanStartNodesAdded() {
237241 hostProcess .run ();
238242 // Then
239243 assertThat (hostProcess .getTestTotalCount (), is (equalTo (2 )));
244+ assertThat (hostProcess .getStartNodes ().size (), is (2 ));
245+ assertThat (
246+ hostProcess .getStartNodes ().get (0 ).getURI ().toString (),
247+ is ("http://localhost/file1" ));
248+ assertThat (
249+ hostProcess .getStartNodes ().get (1 ).getURI ().toString (),
250+ is ("http://localhost/file2" ));
240251 }
241252
242253 @ Test
You can’t perform that action at this time.
0 commit comments