RED-8702: Explore document databases to store entityLog
* fix for analysisnumber 1 as first
This commit is contained in:
parent
fdfc56f9e6
commit
1c3205851b
@ -265,8 +265,9 @@ public class AnalyzeService {
|
||||
EntityLog entityLog = entityLogChanges.getEntityLog();
|
||||
|
||||
// hotfix for tests : analysis numbers should be incremented in every follow-up request,
|
||||
// then querying if the entity log exists would not be necessary
|
||||
if (entityLog.getAnalysisNumber() <= 0 && !redactionStorageService.entityLogExists(analyzeRequest.getDossierId(), analyzeRequest.getFileId())) {
|
||||
// then querying if the entity log exists would not be necessary something like this could be done instead:
|
||||
// entityLog.getAnalysisNumber() <= 0
|
||||
if (!redactionStorageService.entityLogExists(analyzeRequest.getDossierId(), analyzeRequest.getFileId())) {
|
||||
redactionStorageService.insertEntityLog(analyzeRequest.getDossierId(), analyzeRequest.getFileId(), entityLog);
|
||||
|
||||
} else {
|
||||
|
||||
@ -608,6 +608,7 @@ public class RedactionIntegrationTest extends RulesIntegrationTest {
|
||||
.build()));
|
||||
|
||||
analyzeDocumentStructure(LayoutParsingType.REDACT_MANAGER, request);
|
||||
request.setAnalysisNumber(1);
|
||||
AnalyzeResult result = analyzeService.analyze(request);
|
||||
|
||||
var entityLog = redactionStorageService.getEntityLog(TEST_DOSSIER_ID, TEST_FILE_ID);
|
||||
@ -666,7 +667,7 @@ public class RedactionIntegrationTest extends RulesIntegrationTest {
|
||||
.build()));
|
||||
|
||||
request.setManualRedactions(manualRedactions);
|
||||
|
||||
request.setAnalysisNumber(2);
|
||||
AnalyzeResult reanalyzeResult = analyzeService.reanalyze(request);
|
||||
|
||||
entityLog = redactionStorageService.getEntityLog(TEST_DOSSIER_ID, TEST_FILE_ID);
|
||||
@ -688,6 +689,7 @@ public class RedactionIntegrationTest extends RulesIntegrationTest {
|
||||
|
||||
when(dictionaryClient.getDictionaryForType(VERTEBRATE_INDICATOR, null)).thenReturn(getDictionaryResponse(VERTEBRATE_INDICATOR, false));
|
||||
|
||||
request.setAnalysisNumber(3);
|
||||
analyzeService.reanalyze(request);
|
||||
|
||||
entityLog = redactionStorageService.getEntityLog(TEST_DOSSIER_ID, TEST_FILE_ID);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user