RED-9246: Resize on dossier level for dossier-template-level entry becomes skipped

* fixed failing tests due to cross modification of dictionary entries depending on test execution order
This commit is contained in:
maverickstuder 2024-06-10 14:11:29 +02:00
parent 13363acc83
commit 0676964ae0
2 changed files with 7 additions and 5 deletions

View File

@ -206,6 +206,7 @@ public class DocumineFloraTest extends AbstractRedactionIntegrationTest {
when(rulesClient.getVersion(TEST_DOSSIER_TEMPLATE_ID, RuleFileType.COMPONENT)).thenReturn(System.currentTimeMillis());
when(rulesClient.getRules(TEST_DOSSIER_TEMPLATE_ID, RuleFileType.COMPONENT)).thenReturn(JSONPrimitive.of(COMPONENT_RULES));
loadDictionaryForTest();
loadTypeForTest();
loadNerForTest();
when(dictionaryClient.getVersion(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(0L);

View File

@ -548,6 +548,7 @@ public class RedactionIntegrationTest extends RulesIntegrationTest {
@Test
@Order(2)
public void testChangeComputation() throws IOException {
String fileName = "files/syngenta/CustomerFiles/SinglePages/test1S1T1.pdf";
@ -558,15 +559,15 @@ public class RedactionIntegrationTest extends RulesIntegrationTest {
analyzeDocumentStructure(LayoutParsingType.REDACT_MANAGER, request);
analyzeService.analyze(request);
dictionary.get(DICTIONARY_AUTHOR).add("report");
reanlysisVersions.put("report", 2L);
dictionary.get(DICTIONARY_AUTHOR).add("EFSA conclusion");
reanlysisVersions.put("EFSA conclusion", 2L);
when(dictionaryClient.getVersion(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(2L);
mockDictionaryCalls(0L);
analyzeService.reanalyze(request);
dictionary.get(DICTIONARY_AUTHOR).add("assessment report");
reanlysisVersions.put("assessment report", 3L);
dictionary.get(DICTIONARY_AUTHOR).add("draft EFSA conclusion");
reanlysisVersions.put("draft EFSA conclusion", 3L);
when(dictionaryClient.getVersion(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(3L);
mockDictionaryCalls(2L);
analyzeService.reanalyze(request);
@ -579,7 +580,7 @@ public class RedactionIntegrationTest extends RulesIntegrationTest {
var changes = entityLog.getEntityLogEntry()
.stream()
.filter(entry -> entry.getValue() != null && entry.getValue().equals("report"))
.filter(entry -> entry.getValue() != null && entry.getValue().equals("EFSA conclusion"))
.findFirst()
.get().getChanges();