From f9134498d3f1ec3ff93ffd69284361fe52034467 Mon Sep 17 00:00:00 2001 From: Camilo Cota <1499184+ccronca@users.noreply.github.com> Date: Fri, 8 Nov 2024 09:38:53 +0100 Subject: [PATCH] test that openapi job is not added when no openapi config exists (#257) * test that openapi job is not added when no openapi config exists --- tests/scanners/zap/test_setup.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/scanners/zap/test_setup.py b/tests/scanners/zap/test_setup.py index 72eba6ea..9c076d67 100644 --- a/tests/scanners/zap/test_setup.py +++ b/tests/scanners/zap/test_setup.py @@ -61,6 +61,15 @@ def test_setup_no_api_config(test_config): test_zap.setup() + # openapi job is not added when no openapi config exists + test_config.delete("scanners.zap.apiScan") + test_zap = ZapNone(config=test_config) + + test_zap.setup() + + for item in test_zap.automation_config["jobs"]: + assert item["type"] != "openapi" + ## Testing Authentication methods ## ### Handling Authentication is different depending on the container.type so it'd be better to have test cases separately