From f5f84948ee7a9a0678b731bb571fc21dfeaedab7 Mon Sep 17 00:00:00 2001 From: deiflaender Date: Mon, 14 Mar 2022 14:06:49 +0100 Subject: [PATCH] Fixed unittests --- .../v1/server/RedactionIntegrationTest.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/redaction-service-v1/redaction-service-server-v1/src/test/java/com/iqser/red/service/redaction/v1/server/RedactionIntegrationTest.java b/redaction-service-v1/redaction-service-server-v1/src/test/java/com/iqser/red/service/redaction/v1/server/RedactionIntegrationTest.java index 6a90fd43..1027dca5 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/test/java/com/iqser/red/service/redaction/v1/server/RedactionIntegrationTest.java +++ b/redaction-service-v1/redaction-service-server-v1/src/test/java/com/iqser/red/service/redaction/v1/server/RedactionIntegrationTest.java @@ -208,10 +208,6 @@ public class RedactionIntegrationTest { mockDictionaryCalls(null); mockDictionaryCalls(0L); - mockDictionaryCalls(1L); - mockDictionaryCalls(2L); - mockDictionaryCalls(3L); - mockDictionaryCalls(4L); when(dictionaryClient.getColors(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(colors); } @@ -566,17 +562,18 @@ public class RedactionIntegrationTest { dictionary.get(AUTHOR).add("report"); reanlysisVersions.put("report", 2L); when(dictionaryClient.getVersion(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(2L); - when(dictionaryClient.getDictionaryForType(AUTHOR + ":" + TEST_DOSSIER_TEMPLATE_ID, 2L)).thenReturn(getDictionaryResponse(AUTHOR, false)); + mockDictionaryCalls(0L); + analyzeService.reanalyze(request); dictionary.get(AUTHOR).add("assessment report"); reanlysisVersions.put("assessment report", 3L); when(dictionaryClient.getVersion(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(3L); - when(dictionaryClient.getDictionaryForType(AUTHOR + ":" + TEST_DOSSIER_TEMPLATE_ID, 3L)).thenReturn(getDictionaryResponse(AUTHOR, false)); + mockDictionaryCalls(2L); analyzeService.reanalyze(request); when(dictionaryClient.getVersion(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(3L); - when(dictionaryClient.getDictionaryForType(AUTHOR + ":" + TEST_DOSSIER_TEMPLATE_ID, 3L)).thenReturn(getDictionaryResponse(AUTHOR, false)); + mockDictionaryCalls(3L); analyzeService.reanalyze(request); var redactionLog = redactionStorageService.getRedactionLog(TEST_DOSSIER_ID, TEST_FILE_ID); @@ -660,6 +657,7 @@ public class RedactionIntegrationTest { dictionary.get(AUTHOR).add("properties"); reanlysisVersions.put("properties", 1L); + mockDictionaryCalls(0L); dictionary.get(AUTHOR).add("physical"); reanlysisVersions.put("physical", 2L); @@ -709,6 +707,7 @@ public class RedactionIntegrationTest { deleted.remove("mouse"); reanlysisVersions.put("mouse", 4L); + mockDictionaryCalls(3L); when(dictionaryClient.getVersion(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(4L);