From 8acf752ba12ef38d0bf75690c421f907e93b763e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gst=C3=B6hl?= Date: Thu, 10 Feb 2022 13:12:59 +0100 Subject: [PATCH] add wallet mode removal test --- .../ws/controller/VerificationRulesControllerV2Test.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ch-covidcertificate-backend-verifier/ch-covidcertificate-backend-verifier-ws/src/test/java/ch/admin/bag/covidcertificate/backend/verifier/ws/controller/VerificationRulesControllerV2Test.java b/ch-covidcertificate-backend-verifier/ch-covidcertificate-backend-verifier-ws/src/test/java/ch/admin/bag/covidcertificate/backend/verifier/ws/controller/VerificationRulesControllerV2Test.java index 2c564ce4..98ef07a5 100644 --- a/ch-covidcertificate-backend-verifier/ch-covidcertificate-backend-verifier-ws/src/test/java/ch/admin/bag/covidcertificate/backend/verifier/ws/controller/VerificationRulesControllerV2Test.java +++ b/ch-covidcertificate-backend-verifier/ch-covidcertificate-backend-verifier-ws/src/test/java/ch/admin/bag/covidcertificate/backend/verifier/ws/controller/VerificationRulesControllerV2Test.java @@ -72,6 +72,7 @@ public void verificationRulesTest() throws Exception { boolean modeExists = false; var iter = expected.get("modeRules").get("activeModes").iterator(); var verifierIter = expected.get("modeRules").get("verifierActiveModes").iterator(); + var walletIter = expected.get("modeRules").get("walletActiveModes").iterator(); while (iter.hasNext()) { JsonNode mode = iter.next(); if (disabledMode.equals(mode.get("id").asText())) { @@ -86,6 +87,13 @@ public void verificationRulesTest() throws Exception { verifierIter.remove(); } } + while (walletIter.hasNext()) { + JsonNode mode = walletIter.next(); + if (disabledMode.equals(mode.get("id").asText())) { + modeExists = true; + walletIter.remove(); + } + } if (!modeExists) { throw new IllegalArgumentException( "JSON doesn't seem to have the mode we're testing for. Edit test case or JSON");