From aff7074b4012627a4e8b64b2f4a779b18feed50a Mon Sep 17 00:00:00 2001 From: Thomas Beyer Date: Fri, 28 Apr 2023 16:54:16 +0200 Subject: [PATCH] RED-6619 - renamed variables --- .../v1/server/RedactionIntegrationV2Test.java | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/redaction-service-v1/redaction-service-server-v1/src/test/java/com/iqser/red/service/redaction/v1/server/RedactionIntegrationV2Test.java b/redaction-service-v1/redaction-service-server-v1/src/test/java/com/iqser/red/service/redaction/v1/server/RedactionIntegrationV2Test.java index b1ad23e9..0f9e77a6 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/test/java/com/iqser/red/service/redaction/v1/server/RedactionIntegrationV2Test.java +++ b/redaction-service-v1/redaction-service-server-v1/src/test/java/com/iqser/red/service/redaction/v1/server/RedactionIntegrationV2Test.java @@ -3,7 +3,6 @@ package com.iqser.red.service.redaction.v1.server; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; -import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.BeforeEach; @@ -90,7 +89,7 @@ public class RedactionIntegrationV2Test extends AbstractRedactionIntegrationTest /** * The case in this test: One term, 'Dr. Alan Miller', is found by PII-Rule and is in the PII-dictionary * as well as in the PII-false-positive-list - and in the CBI-author dictionary. - * It gets redacted, as the PII-finding is false positive and so the CBI-author entry is effective + * It gets redacted, as the PII-finding is false positive and so the CBI-author entry is effective, * independent of the entity-rank */ @Test @@ -99,15 +98,18 @@ public class RedactionIntegrationV2Test extends AbstractRedactionIntegrationTest AnalyzeRequest request = uploadFileToStorage("files/new/simplified2.pdf"); - String name = "Dr. Alan Miller"; - String nameWithCompletionDate = "Dr. Alan Miller COMPLETION DATE:"; + String entryAuthorAndPIIDictionary = "Dr. Alan Miller"; - dictionary.get(DICTIONARY_AUTHOR).add(name); - dictionary.put(DICTIONARY_PII, Arrays.asList(name)); - falsePositive.put(DICTIONARY_PII, Arrays.asList(nameWithCompletionDate)); + dictionary.get(DICTIONARY_AUTHOR).add(entryAuthorAndPIIDictionary); + dictionary.put(DICTIONARY_PII, List.of(entryAuthorAndPIIDictionary)); + + String entryPIIFalsePositive = "Dr. Alan Miller COMPLETION DATE:"; + + falsePositive.put(DICTIONARY_PII, List.of(entryPIIFalsePositive)); + + reanlysisVersions.put(entryAuthorAndPIIDictionary, 1L); + reanlysisVersions.put(entryPIIFalsePositive, 1L); - reanlysisVersions.put(name, 1L); - reanlysisVersions.put(nameWithCompletionDate, 1L); when(dictionaryClient.getVersion(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(3L); mockDictionaryCalls(0L); @@ -121,7 +123,7 @@ public class RedactionIntegrationV2Test extends AbstractRedactionIntegrationTest RedactionLogEntry redactionLogEntry = redactionLog.getRedactionLogEntry().get(0); assertThat(redactionLogEntry.getType()).isEqualTo(DICTIONARY_AUTHOR); - assertThat(redactionLogEntry.getValue()).isEqualTo(name); + assertThat(redactionLogEntry.getValue()).isEqualTo(entryAuthorAndPIIDictionary); assertThat(redactionLogEntry.isRedacted()).isEqualTo(true); assertThat(redactionLogEntry.isRecommendation()).isEqualTo(false); assertThat(redactionLogEntry.isFalsePositive()).isEqualTo(false); @@ -146,8 +148,8 @@ public class RedactionIntegrationV2Test extends AbstractRedactionIntegrationTest dictionary.clear(); falsePositive.clear(); - String name = "Evans P.G."; - dictionary.put(DICTIONARY_AUTHOR, Arrays.asList(name)); + String entryAuthorDictionary = "Evans P.G."; + dictionary.put(DICTIONARY_AUTHOR, List.of(entryAuthorDictionary)); analyzeService.analyzeDocumentStructure(new StructureAnalyzeRequest(request.getDossierId(), request.getFileId())); analyzeService.analyze(request); @@ -159,7 +161,7 @@ public class RedactionIntegrationV2Test extends AbstractRedactionIntegrationTest RedactionLogEntry redactionLogEntry = redactionLog.getRedactionLogEntry().get(0); assertThat(redactionLogEntry.getType()).isEqualTo(DICTIONARY_AUTHOR); - assertThat(redactionLogEntry.getValue()).isEqualTo(name); + assertThat(redactionLogEntry.getValue()).isEqualTo(entryAuthorDictionary); assertThat(redactionLogEntry.isRedacted()).isEqualTo(true); assertThat(redactionLogEntry.isRecommendation()).isEqualTo(false); assertThat(redactionLogEntry.isFalsePositive()).isEqualTo(false);