Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automation: let job report alert tests support #5606

Merged
merged 1 commit into from
Jul 25, 2024
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 @@ -493,6 +493,10 @@ public void logTestsToProgress(AutomationProgress progress) {
tests.forEach(t -> t.logToProgress(progress));
}

public boolean supportsAlertTests() {
return false;
}

public boolean supportsMonitorTests() {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import org.parosproxy.paros.view.View;
import org.zaproxy.addon.automation.AutomationEventPublisher;
import org.zaproxy.addon.automation.AutomationJob;
import org.zaproxy.addon.automation.jobs.ActiveScanJob;
import org.zaproxy.addon.automation.jobs.PassiveScanWaitJob;
import org.zaproxy.addon.automation.tests.AbstractAutomationTest;
import org.zaproxy.addon.automation.tests.AutomationAlertTest;
import org.zaproxy.addon.automation.tests.AutomationMonitorTest;
Expand Down Expand Up @@ -60,7 +58,7 @@ public AddTestDialog(AutomationJob job) {
}
testNames.add(Constant.messages.getString(URL_PRESENCE_TEST_NAME));

if (job instanceof PassiveScanWaitJob || job instanceof ActiveScanJob) {
if (job.supportsAlertTests()) {
testNames.add(Constant.messages.getString(ALERT_TEST_NAME));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ public ActiveScanJob() {
data = new Data(this, this.parameters, this.policyDefinition);
}

@Override
public boolean supportsAlertTests() {
return true;
}

private ExtensionActiveScan getExtAScan() {
if (extAScan == null) {
extAScan =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public PassiveScanWaitJob() {
this.data = new Data(this, parameters);
}

@Override
public boolean supportsAlertTests() {
return true;
}

@Override
public void runJob(AutomationEnvironment env, AutomationProgress progress) {
ExtensionPassiveScan extPScan = getExtPassiveScan();
Expand Down
Loading