Pull request #75: Rename sponsor dictionary to CBI_sponsor
Merge in RED/redaction-service from CBI_sponsor to master * commit 'd466d9b0328d04967b9026a45ff57d49b7f89ec6': Rename sponsor dictionary to CBI_sponsor
This commit is contained in:
commit
3c942aba15
@ -69,7 +69,7 @@ public class RedactionIntegrationTest {
|
|||||||
private static final String VERTEBRATE = "vertebrate";
|
private static final String VERTEBRATE = "vertebrate";
|
||||||
private static final String ADDRESS = "CBI_address";
|
private static final String ADDRESS = "CBI_address";
|
||||||
private static final String AUTHOR = "CBI_author";
|
private static final String AUTHOR = "CBI_author";
|
||||||
private static final String SPONSOR = "sponsor";
|
private static final String SPONSOR = "CBI_sponsor";
|
||||||
private static final String NO_REDACTION_INDICATOR = "no_redaction_indicator";
|
private static final String NO_REDACTION_INDICATOR = "no_redaction_indicator";
|
||||||
private static final String REDACTION_INDICATOR = "redaction_indicator";
|
private static final String REDACTION_INDICATOR = "redaction_indicator";
|
||||||
private static final String HINT_ONLY = "hint_only";
|
private static final String HINT_ONLY = "hint_only";
|
||||||
@ -149,7 +149,7 @@ public class RedactionIntegrationTest {
|
|||||||
.map(this::cleanDictionaryEntry)
|
.map(this::cleanDictionaryEntry)
|
||||||
.collect(Collectors.toSet()));
|
.collect(Collectors.toSet()));
|
||||||
dictionary.computeIfAbsent(SPONSOR, v -> new ArrayList<>())
|
dictionary.computeIfAbsent(SPONSOR, v -> new ArrayList<>())
|
||||||
.addAll(ResourceLoader.load("dictionaries/sponsor.txt")
|
.addAll(ResourceLoader.load("dictionaries/CBI_sponsor.txt")
|
||||||
.stream()
|
.stream()
|
||||||
.map(this::cleanDictionaryEntry)
|
.map(this::cleanDictionaryEntry)
|
||||||
.collect(Collectors.toSet()));
|
.collect(Collectors.toSet()));
|
||||||
|
|||||||
@ -230,7 +230,7 @@ public class EntityRedactionServiceTest {
|
|||||||
.build();
|
.build();
|
||||||
when(dictionaryClient.getDictionaryForType(ADDRESS_CODE)).thenReturn(addressResponse);
|
when(dictionaryClient.getDictionaryForType(ADDRESS_CODE)).thenReturn(addressResponse);
|
||||||
DictionaryResponse sponsorResponse = DictionaryResponse.builder()
|
DictionaryResponse sponsorResponse = DictionaryResponse.builder()
|
||||||
.entries(new ArrayList<>(ResourceLoader.load("dictionaries/sponsor.txt")))
|
.entries(new ArrayList<>(ResourceLoader.load("dictionaries/CBI_sponsor.txt")))
|
||||||
.build();
|
.build();
|
||||||
when(dictionaryClient.getDictionaryForType(SPONSOR_CODE)).thenReturn(sponsorResponse);
|
when(dictionaryClient.getDictionaryForType(SPONSOR_CODE)).thenReturn(sponsorResponse);
|
||||||
try (PDDocument pdDocument = PDDocument.load(pdfFileResource.getInputStream())) {
|
try (PDDocument pdDocument = PDDocument.load(pdfFileResource.getInputStream())) {
|
||||||
@ -340,7 +340,7 @@ public class EntityRedactionServiceTest {
|
|||||||
.build();
|
.build();
|
||||||
when(dictionaryClient.getDictionaryForType(AUTHOR_CODE)).thenReturn(authorResponse);
|
when(dictionaryClient.getDictionaryForType(AUTHOR_CODE)).thenReturn(authorResponse);
|
||||||
DictionaryResponse dictionaryResponse = DictionaryResponse.builder()
|
DictionaryResponse dictionaryResponse = DictionaryResponse.builder()
|
||||||
.entries(new ArrayList<>(ResourceLoader.load("dictionaries/sponsor.txt")))
|
.entries(new ArrayList<>(ResourceLoader.load("dictionaries/CBI_sponsor.txt")))
|
||||||
.build();
|
.build();
|
||||||
when(dictionaryClient.getDictionaryForType(SPONSOR_CODE)).thenReturn(dictionaryResponse);
|
when(dictionaryClient.getDictionaryForType(SPONSOR_CODE)).thenReturn(dictionaryResponse);
|
||||||
try (PDDocument pdDocument = PDDocument.load(pdfFileResource.getInputStream())) {
|
try (PDDocument pdDocument = PDDocument.load(pdfFileResource.getInputStream())) {
|
||||||
|
|||||||
@ -85,7 +85,7 @@ rule "9: Redact sponsor company"
|
|||||||
when
|
when
|
||||||
Section(searchText.toLowerCase().contains("batches produced at"))
|
Section(searchText.toLowerCase().contains("batches produced at"))
|
||||||
then
|
then
|
||||||
section.redactIfPrecededBy("batches produced at", "sponsor", 9, "Redacted because it represents a sponsor company", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
section.redactIfPrecededBy("batches produced at", "CBI_sponsor", 9, "Redacted because it represents a sponsor company", "Reg (EC) No 1107/2009 Art. 63 (2g)");
|
||||||
section.addHintAnnotation("batches produced at", "must_redact");
|
section.addHintAnnotation("batches produced at", "must_redact");
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user