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();
|
EntityLog entityLog = entityLogChanges.getEntityLog();
|
||||||
|
|
||||||
// hotfix for tests : analysis numbers should be incremented in every follow-up request,
|
// hotfix for tests : analysis numbers should be incremented in every follow-up request,
|
||||||
// then querying if the entity log exists would not be necessary
|
// then querying if the entity log exists would not be necessary something like this could be done instead:
|
||||||
if (entityLog.getAnalysisNumber() <= 0 && !redactionStorageService.entityLogExists(analyzeRequest.getDossierId(), analyzeRequest.getFileId())) {
|
// entityLog.getAnalysisNumber() <= 0
|
||||||
|
if (!redactionStorageService.entityLogExists(analyzeRequest.getDossierId(), analyzeRequest.getFileId())) {
|
||||||
redactionStorageService.insertEntityLog(analyzeRequest.getDossierId(), analyzeRequest.getFileId(), entityLog);
|
redactionStorageService.insertEntityLog(analyzeRequest.getDossierId(), analyzeRequest.getFileId(), entityLog);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -608,6 +608,7 @@ public class RedactionIntegrationTest extends RulesIntegrationTest {
|
|||||||
.build()));
|
.build()));
|
||||||
|
|
||||||
analyzeDocumentStructure(LayoutParsingType.REDACT_MANAGER, request);
|
analyzeDocumentStructure(LayoutParsingType.REDACT_MANAGER, request);
|
||||||
|
request.setAnalysisNumber(1);
|
||||||
AnalyzeResult result = analyzeService.analyze(request);
|
AnalyzeResult result = analyzeService.analyze(request);
|
||||||
|
|
||||||
var entityLog = redactionStorageService.getEntityLog(TEST_DOSSIER_ID, TEST_FILE_ID);
|
var entityLog = redactionStorageService.getEntityLog(TEST_DOSSIER_ID, TEST_FILE_ID);
|
||||||
@ -666,7 +667,7 @@ public class RedactionIntegrationTest extends RulesIntegrationTest {
|
|||||||
.build()));
|
.build()));
|
||||||
|
|
||||||
request.setManualRedactions(manualRedactions);
|
request.setManualRedactions(manualRedactions);
|
||||||
|
request.setAnalysisNumber(2);
|
||||||
AnalyzeResult reanalyzeResult = analyzeService.reanalyze(request);
|
AnalyzeResult reanalyzeResult = analyzeService.reanalyze(request);
|
||||||
|
|
||||||
entityLog = redactionStorageService.getEntityLog(TEST_DOSSIER_ID, TEST_FILE_ID);
|
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));
|
when(dictionaryClient.getDictionaryForType(VERTEBRATE_INDICATOR, null)).thenReturn(getDictionaryResponse(VERTEBRATE_INDICATOR, false));
|
||||||
|
|
||||||
|
request.setAnalysisNumber(3);
|
||||||
analyzeService.reanalyze(request);
|
analyzeService.reanalyze(request);
|
||||||
|
|
||||||
entityLog = redactionStorageService.getEntityLog(TEST_DOSSIER_ID, TEST_FILE_ID);
|
entityLog = redactionStorageService.getEntityLog(TEST_DOSSIER_ID, TEST_FILE_ID);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user