Merge branch 'RED-6929' into 'master'

RED-6929: fix acceptance tests/rules

Closes RED-6929

See merge request redactmanager/redaction-service!13
This commit is contained in:
Kilian Schüttler 2023-06-22 18:05:08 +02:00
commit b5bfa68b2d
2 changed files with 26 additions and 1 deletions

View File

@ -141,7 +141,7 @@ public class RedactionEntity {
if (matchedRules.isEmpty()) {
return "";
}
return matchedRules.getFirst();
return matchedRules.getLast();
}

View File

@ -0,0 +1,25 @@
package com.iqser.red.service.redaction.v1.server.document.entity;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
import com.iqser.red.service.redaction.v1.server.layoutparsing.document.graph.Boundary;
import com.iqser.red.service.redaction.v1.server.layoutparsing.document.graph.entity.EntityType;
import com.iqser.red.service.redaction.v1.server.layoutparsing.document.graph.entity.RedactionEntity;
public class RedactionEntityTest {
@Test
public void testMatchedRule() {
RedactionEntity entity = RedactionEntity.initialEntityNode(new Boundary(1, 100), "PII", EntityType.ENTITY);
entity.addMatchedRule("CBI.1.0");
entity.addMatchedRule("CBI.2.0");
entity.addMatchedRule("CBI.3.0");
entity.addMatchedRule("CBI.4.0");
assertThat(entity.getMatchedRule()).isEqualTo("CBI.4.0");
assertThat(entity.getMatchedRuleUnit()).isEqualTo(4);
}
}