diff --git a/addOns/automation/src/main/java/org/zaproxy/addon/automation/AutomationJob.java b/addOns/automation/src/main/java/org/zaproxy/addon/automation/AutomationJob.java index c18d04b1ae9..1e7e30bf64b 100644 --- a/addOns/automation/src/main/java/org/zaproxy/addon/automation/AutomationJob.java +++ b/addOns/automation/src/main/java/org/zaproxy/addon/automation/AutomationJob.java @@ -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; } diff --git a/addOns/automation/src/main/java/org/zaproxy/addon/automation/gui/AddTestDialog.java b/addOns/automation/src/main/java/org/zaproxy/addon/automation/gui/AddTestDialog.java index bc8f508861c..8f9084c6210 100644 --- a/addOns/automation/src/main/java/org/zaproxy/addon/automation/gui/AddTestDialog.java +++ b/addOns/automation/src/main/java/org/zaproxy/addon/automation/gui/AddTestDialog.java @@ -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; @@ -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)); } diff --git a/addOns/automation/src/main/java/org/zaproxy/addon/automation/jobs/ActiveScanJob.java b/addOns/automation/src/main/java/org/zaproxy/addon/automation/jobs/ActiveScanJob.java index 0d78d43349b..de8b10c5b15 100644 --- a/addOns/automation/src/main/java/org/zaproxy/addon/automation/jobs/ActiveScanJob.java +++ b/addOns/automation/src/main/java/org/zaproxy/addon/automation/jobs/ActiveScanJob.java @@ -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 = diff --git a/addOns/automation/src/main/java/org/zaproxy/addon/automation/jobs/PassiveScanWaitJob.java b/addOns/automation/src/main/java/org/zaproxy/addon/automation/jobs/PassiveScanWaitJob.java index f3d34154602..58ad19385e0 100644 --- a/addOns/automation/src/main/java/org/zaproxy/addon/automation/jobs/PassiveScanWaitJob.java +++ b/addOns/automation/src/main/java/org/zaproxy/addon/automation/jobs/PassiveScanWaitJob.java @@ -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();