Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,14 @@
// ZAP: 2022/09/21 Use format specifiers instead of concatenation when logging.
// ZAP: 2023/01/10 Tidy up logger.
// ZAP: 2023/05/17 Skip rules that reach the maximum number of alerts.
// ZAP: 2026/05/28 From now on we will not be recording changes here as the files have changed so
// much.
package org.parosproxy.paros.core.scanner;

import java.io.IOException;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
Expand Down Expand Up @@ -330,6 +333,16 @@ public void addStartNode(StructuralNode startNode) {
this.startNodes.add(startNode);
}

/**
* Gets the start nodes.
*
* @return the start nodes
* @since 2.18.0
*/
public List<StructuralNode> getStartNodes() {
return Collections.unmodifiableList(this.startNodes);
}

/** Stop the current scanning process */
public void stop() {
isStop = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ void shouldScanStartNodeSet() {
hostProcess.run();
// Then
assertThat(hostProcess.getTestTotalCount(), is(equalTo(1)));
assertThat(hostProcess.getStartNodes().size(), is(1));
assertThat(
hostProcess.getStartNodes().get(0).getURI().toString(),
is("http://localhost/file"));
}

@Test
Expand All @@ -237,6 +241,13 @@ void shouldScanStartNodesAdded() {
hostProcess.run();
// Then
assertThat(hostProcess.getTestTotalCount(), is(equalTo(2)));
assertThat(hostProcess.getStartNodes().size(), is(2));
assertThat(
hostProcess.getStartNodes().get(0).getURI().toString(),
is("http://localhost/file1"));
assertThat(
hostProcess.getStartNodes().get(1).getURI().toString(),
is("http://localhost/file2"));
}

@Test
Expand Down
Loading