RED-8428 - Add RESIZE_LOCALLY and RESIZE_IN_DICTIONARY in ManualRedactionType to differentiate between the two operations #336

Merged
andrei.isvoran.ext merged 2 commits from RED-8428 into master 2024-02-05 09:20:19 +01:00
5 changed files with 8 additions and 8 deletions

View File

@ -6,7 +6,6 @@ import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import com.iqser.red.service.persistence.management.v1.processor.entity.annotations.ViewedPageEntity;
@ -158,7 +157,7 @@ public class AnalysisFlagsCalculationService {
manualChange.getManualRedactionType().equals(ManualRedactionType.FORCE_REDACT) || //
manualChange.getManualRedactionType().equals(ManualRedactionType.FORCE_HINT) || //
manualChange.getManualRedactionType().equals(ManualRedactionType.LEGAL_BASIS_CHANGE) || //
manualChange.getManualRedactionType().equals(ManualRedactionType.RESIZE)) && //
manualChange.getManualRedactionType().equals(ManualRedactionType.RESIZE_LOCALLY)) && //
manualChange.getProcessedDate() != null && //
(lastRedactionModification == null || manualChange.getProcessedDate().isAfter(lastRedactionModification));
}

View File

@ -205,7 +205,7 @@ public class EntityLogMergeService {
entityLogEntry.setValue(manualResizeRedaction.getValue());
addChanges(entityLogEntry.getChanges(), ChangeType.CHANGED, analysisNumber, manualResizeRedaction.getRequestDate());
ManualChange.ManualChangeBuilder manualChange = ManualChange.builder()
.manualRedactionType(ManualRedactionType.RESIZE)
.manualRedactionType(manualResizeRedaction.getUpdateDictionary() ? ManualRedactionType.RESIZE_IN_DICTIONARY : ManualRedactionType.RESIZE_LOCALLY)
.requestedDate(manualResizeRedaction.getRequestDate())
.processedDate(null)
.userId(manualResizeRedaction.getUser());

View File

@ -21,13 +21,11 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mockito;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.testcontainers.shaded.com.google.common.collect.Lists;
import com.iqser.red.service.persistence.management.v1.processor.configuration.MessagingConfiguration;
import com.iqser.red.service.persistence.management.v1.processor.entity.configuration.TypeEntity;
import com.iqser.red.service.persistence.management.v1.processor.entity.dossier.DossierEntity;
import com.iqser.red.service.persistence.management.v1.processor.entity.dossier.FileEntity;
@ -167,7 +165,7 @@ public class EntityLogMergeTest {
assertEquals(resizeEntryLogEntry.getPositions().get(0).getPageNumber(), 1);
assertEquals(resizeEntryLogEntry.getEntryType(), EntryType.ENTITY);
assertEquals(resizeEntryLogEntry.getState(), EntryState.APPLIED);
assertEquals(resizeEntryLogEntry.getManualChanges().get(0).getManualRedactionType(), ManualRedactionType.RESIZE);
assertEquals(resizeEntryLogEntry.getManualChanges().get(0).getManualRedactionType(), ManualRedactionType.RESIZE_LOCALLY);
assertEquals(resizeEntryLogEntry.getChanges().get(0).getType(), ChangeType.CHANGED);
var optionalLegalBasisEntryLogEntry = response.getEntityLogEntry().stream().filter(entityLogEntry1 -> entityLogEntry1.getId().equals(entryLegalBasisId)).findFirst();
@ -292,6 +290,7 @@ public class EntityLogMergeTest {
.annotationId(entryToResizeId)
.positions(positions)
.requestDate(OffsetDateTime.now())
.updateDictionary(false)
.build()
))
.legalBasisChanges(Set.of(

View File

@ -9,5 +9,6 @@ public enum ManualRedactionType {
FORCE_HINT,
RECATEGORIZE,
LEGAL_BASIS_CHANGE,
RESIZE
RESIZE_LOCALLY,
RESIZE_IN_DICTIONARY
}

View File

@ -10,5 +10,6 @@ public enum ManualRedactionType {
FORCE_HINT,
RECATEGORIZE,
LEGAL_BASIS_CHANGE,
RESIZE
RESIZE_LOCALLY,
RESIZE_IN_DICTIONARY
}