RED-8480: added some checks and tests
This commit is contained in:
parent
d2b6971f04
commit
e681651420
@ -9,6 +9,7 @@ import java.util.Set;
|
|||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.iqser.red.service.persistence.management.v1.processor.exception.BadRequestException;
|
||||||
import com.iqser.red.service.persistence.management.v1.processor.exception.NotFoundException;
|
import com.iqser.red.service.persistence.management.v1.processor.exception.NotFoundException;
|
||||||
import com.iqser.red.service.persistence.management.v1.processor.service.EntityLogService;
|
import com.iqser.red.service.persistence.management.v1.processor.service.EntityLogService;
|
||||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLog;
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLog;
|
||||||
@ -142,6 +143,7 @@ public class ManualRedactionMapper {
|
|||||||
EntityLog entityLog = entityLogService.getEntityLog(dossierId, fileId, Collections.emptyList(), includeUnprocessed);
|
EntityLog entityLog = entityLogService.getEntityLog(dossierId, fileId, Collections.emptyList(), includeUnprocessed);
|
||||||
List<RecategorizationRequest> requests = new ArrayList<>();
|
List<RecategorizationRequest> requests = new ArrayList<>();
|
||||||
for (RecategorizationRequestModel recategorizationRequest : recategorizationRequests) {
|
for (RecategorizationRequestModel recategorizationRequest : recategorizationRequests) {
|
||||||
|
checkLegalBasisIsNotNull(recategorizationRequest.getLegalBasis());
|
||||||
EntityLogEntry entityLogEntry = getEntityLogEntry(entityLog, recategorizationRequest.getAnnotationId());
|
EntityLogEntry entityLogEntry = getEntityLogEntry(entityLog, recategorizationRequest.getAnnotationId());
|
||||||
RecategorizationRequest build = RecategorizationRequest.builder()
|
RecategorizationRequest build = RecategorizationRequest.builder()
|
||||||
.annotationId(recategorizationRequest.getAnnotationId())
|
.annotationId(recategorizationRequest.getAnnotationId())
|
||||||
@ -164,6 +166,13 @@ public class ManualRedactionMapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void checkLegalBasisIsNotNull(String legalBasis) {
|
||||||
|
if(legalBasis == null) {
|
||||||
|
throw new BadRequestException("No legal basis provided.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<ResizeRedactionRequest> toResizeRedactionRequestList(Set<ResizeRedactionRequestModel> resizeRedactionRequests) {
|
public List<ResizeRedactionRequest> toResizeRedactionRequestList(Set<ResizeRedactionRequestModel> resizeRedactionRequests) {
|
||||||
|
|
||||||
return resizeRedactionRequests.stream()
|
return resizeRedactionRequests.stream()
|
||||||
|
|||||||
@ -75,6 +75,8 @@ public class ManualRedactionService {
|
|||||||
EntityLogMergeService entityLogMergeService;
|
EntityLogMergeService entityLogMergeService;
|
||||||
FileStatusPersistenceService fileStatusPersistenceService;
|
FileStatusPersistenceService fileStatusPersistenceService;
|
||||||
|
|
||||||
|
private static final int MAX_LEGAL_BASIS_LENGTH = 4000;
|
||||||
|
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Observed(name = "ManualRedactionService", contextualName = "add-manual-redaction")
|
@Observed(name = "ManualRedactionService", contextualName = "add-manual-redaction")
|
||||||
@ -101,7 +103,8 @@ public class ManualRedactionService {
|
|||||||
|
|
||||||
Long commentId = commentService.addCommentAndGetId(fileId, annotationId, addRedactionRequest.getComment(), addRedactionRequest.getUser());
|
Long commentId = commentService.addCommentAndGetId(fileId, annotationId, addRedactionRequest.getComment(), addRedactionRequest.getUser());
|
||||||
|
|
||||||
response.add(ManualAddResponse.builder().annotationId(annotationId).commentId(commentId).build());
|
response.add(ManualAddResponse.builder().annotationId(annotationId).commentId(commentId)
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
manualRedactionEntryEntities = manualRedactionEntryEntities.stream()
|
manualRedactionEntryEntities = manualRedactionEntryEntities.stream()
|
||||||
@ -110,7 +113,8 @@ public class ManualRedactionService {
|
|||||||
|
|
||||||
FileModel fileStatus = fileStatusService.getStatus(fileId);
|
FileModel fileStatus = fileStatusService.getStatus(fileId);
|
||||||
if (!manualRedactionEntryEntities.isEmpty() && fileStatus.isExcludedFromAutomaticAnalysis()) {
|
if (!manualRedactionEntryEntities.isEmpty() && fileStatus.isExcludedFromAutomaticAnalysis()) {
|
||||||
ManualRedactions manualRedactions = ManualRedactions.builder().entriesToAdd(convertEntriesToAdd(manualRedactionEntryEntities)).build();
|
ManualRedactions manualRedactions = ManualRedactions.builder().entriesToAdd(convertEntriesToAdd(manualRedactionEntryEntities))
|
||||||
|
.build();
|
||||||
entityLogMergeService.sendToAnalyseQueue(fileId, dossierEntity, fileStatusService.getStatus(fileId), manualRedactions);
|
entityLogMergeService.sendToAnalyseQueue(fileId, dossierEntity, fileStatusService.getStatus(fileId), manualRedactions);
|
||||||
} else {
|
} else {
|
||||||
reprocess(dossierId, fileId);
|
reprocess(dossierId, fileId);
|
||||||
@ -123,7 +127,9 @@ public class ManualRedactionService {
|
|||||||
|
|
||||||
private Set<ManualRedactionEntry> convertEntriesToAdd(List<ManualRedactionEntryEntity> source) {
|
private Set<ManualRedactionEntry> convertEntriesToAdd(List<ManualRedactionEntryEntity> source) {
|
||||||
|
|
||||||
return source.stream().map(entry -> convert(entry, ManualRedactionEntry.class, new ManualRedactionMapper())).collect(Collectors.toSet());
|
return source.stream()
|
||||||
|
.map(entry -> convert(entry, ManualRedactionEntry.class, new ManualRedactionMapper()))
|
||||||
|
.collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -150,12 +156,10 @@ public class ManualRedactionService {
|
|||||||
|
|
||||||
boolean removedFromDictionary = !typeIdsOfModifiedDictionaries.isEmpty();
|
boolean removedFromDictionary = !typeIdsOfModifiedDictionaries.isEmpty();
|
||||||
|
|
||||||
removeRedactionPersistenceService.updateModifiedDictionaries(fileId,
|
removeRedactionPersistenceService.updateModifiedDictionaries(fileId, removeRedactionRequest.getAnnotationId(), removedFromDictionary, typeIdsOfModifiedDictionaries);
|
||||||
removeRedactionRequest.getAnnotationId(),
|
|
||||||
removedFromDictionary,
|
|
||||||
typeIdsOfModifiedDictionaries);
|
|
||||||
|
|
||||||
response.add(ManualAddResponse.builder().annotationId(removeRedactionRequest.getAnnotationId()).commentId(commentId).build());
|
response.add(ManualAddResponse.builder().annotationId(removeRedactionRequest.getAnnotationId()).commentId(commentId)
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
reprocess(dossierId, fileId);
|
reprocess(dossierId, fileId);
|
||||||
@ -180,7 +184,8 @@ public class ManualRedactionService {
|
|||||||
forceRedactionRequest.getComment(),
|
forceRedactionRequest.getComment(),
|
||||||
forceRedactionRequest.getUser());
|
forceRedactionRequest.getUser());
|
||||||
|
|
||||||
response.add(ManualAddResponse.builder().annotationId(forceRedactionRequest.getAnnotationId()).commentId(commentId).build());
|
response.add(ManualAddResponse.builder().annotationId(forceRedactionRequest.getAnnotationId()).commentId(commentId)
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
reprocess(dossierId, fileId);
|
reprocess(dossierId, fileId);
|
||||||
@ -205,7 +210,8 @@ public class ManualRedactionService {
|
|||||||
legalBasisChangeRequest.getComment(),
|
legalBasisChangeRequest.getComment(),
|
||||||
legalBasisChangeRequest.getUser());
|
legalBasisChangeRequest.getUser());
|
||||||
|
|
||||||
response.add(ManualAddResponse.builder().annotationId(legalBasisChangeRequest.getAnnotationId()).commentId(commentId).build());
|
response.add(ManualAddResponse.builder().annotationId(legalBasisChangeRequest.getAnnotationId()).commentId(commentId)
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
reprocess(dossierId, fileId);
|
reprocess(dossierId, fileId);
|
||||||
fileStatusPersistenceService.setLastManualChangeDate(fileId, OffsetDateTime.now());
|
fileStatusPersistenceService.setLastManualChangeDate(fileId, OffsetDateTime.now());
|
||||||
@ -224,6 +230,8 @@ public class ManualRedactionService {
|
|||||||
recategorizationRequest.getTypeToRemove(),
|
recategorizationRequest.getTypeToRemove(),
|
||||||
recategorizationRequest.getDossierTemplateId());
|
recategorizationRequest.getDossierTemplateId());
|
||||||
|
|
||||||
|
checkLegalBasisLength(recategorizationRequest.getLegalBasis());
|
||||||
|
|
||||||
recategorizationPersistenceService.insert(fileId, recategorizationRequest);
|
recategorizationPersistenceService.insert(fileId, recategorizationRequest);
|
||||||
|
|
||||||
Set<String> typeIdsOfDictionariesWithAdd = manualRedactionDictionaryUpdateHandler.handleAddToDictionaryAndReturnModifiedTypeIds(fileId,
|
Set<String> typeIdsOfDictionariesWithAdd = manualRedactionDictionaryUpdateHandler.handleAddToDictionaryAndReturnModifiedTypeIds(fileId,
|
||||||
@ -242,7 +250,8 @@ public class ManualRedactionService {
|
|||||||
recategorizationRequest.getComment(),
|
recategorizationRequest.getComment(),
|
||||||
recategorizationRequest.getUser());
|
recategorizationRequest.getUser());
|
||||||
|
|
||||||
response.add(ManualAddResponse.builder().annotationId(recategorizationRequest.getAnnotationId()).commentId(commentId).build());
|
response.add(ManualAddResponse.builder().annotationId(recategorizationRequest.getAnnotationId()).commentId(commentId)
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
reprocess(dossierId, fileId);
|
reprocess(dossierId, fileId);
|
||||||
|
|
||||||
@ -252,6 +261,14 @@ public class ManualRedactionService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void checkLegalBasisLength(String legalBasis) {
|
||||||
|
|
||||||
|
if (legalBasis.length() > MAX_LEGAL_BASIS_LENGTH) {
|
||||||
|
throw new BadRequestException(String.format("The legal basis is too long (%s), max length %s", legalBasis.length(), MAX_LEGAL_BASIS_LENGTH));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Observed(name = "ManualRedactionService", contextualName = "add-manual-redaction")
|
@Observed(name = "ManualRedactionService", contextualName = "add-manual-redaction")
|
||||||
public List<ManualAddResponse> addResizeRedaction(String dossierId, String fileId, List<ResizeRedactionRequest> resizeRedactionRequests, boolean includeUnprocessed) {
|
public List<ManualAddResponse> addResizeRedaction(String dossierId, String fileId, List<ResizeRedactionRequest> resizeRedactionRequests, boolean includeUnprocessed) {
|
||||||
@ -270,15 +287,20 @@ public class ManualRedactionService {
|
|||||||
resizeRedactionRequest.getAnnotationId(),
|
resizeRedactionRequest.getAnnotationId(),
|
||||||
resizeRedactionRequest.getComment(),
|
resizeRedactionRequest.getComment(),
|
||||||
resizeRedactionRequest.getUser());
|
resizeRedactionRequest.getUser());
|
||||||
response.add(ManualAddResponse.builder().annotationId(resizeRedactionRequest.getAnnotationId()).commentId(commentId).build());
|
response.add(ManualAddResponse.builder().annotationId(resizeRedactionRequest.getAnnotationId()).commentId(commentId)
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<String> typeIdsOfModifiedDictionaries = manualRedactionDictionaryUpdateHandler.updateDictionaryForResizeRedactions(dossierId,
|
Set<String> typeIdsOfModifiedDictionaries = manualRedactionDictionaryUpdateHandler.updateDictionaryForResizeRedactions(dossierId,
|
||||||
fileId,
|
fileId,
|
||||||
resizeRedaction,
|
resizeRedaction,
|
||||||
getEntityLogEntry(entityLog, resizeRedaction.getId().getAnnotationId()));
|
getEntityLogEntry(entityLog,
|
||||||
|
resizeRedaction.getId()
|
||||||
|
.getAnnotationId()));
|
||||||
|
|
||||||
resizeRedactionPersistenceService.updateModifiedDictionaries(resizeRedaction.getId().getFileId(), resizeRedaction.getId().getAnnotationId(), typeIdsOfModifiedDictionaries);
|
resizeRedactionPersistenceService.updateModifiedDictionaries(resizeRedaction.getId().getFileId(),
|
||||||
|
resizeRedaction.getId().getAnnotationId(),
|
||||||
|
typeIdsOfModifiedDictionaries);
|
||||||
}
|
}
|
||||||
|
|
||||||
manualResizeRedactionEntities = manualResizeRedactionEntities.stream()
|
manualResizeRedactionEntities = manualResizeRedactionEntities.stream()
|
||||||
@ -287,7 +309,8 @@ public class ManualRedactionService {
|
|||||||
|
|
||||||
FileModel fileStatus = fileStatusService.getStatus(fileId);
|
FileModel fileStatus = fileStatusService.getStatus(fileId);
|
||||||
if (!manualResizeRedactionEntities.isEmpty() && fileStatus.isExcludedFromAutomaticAnalysis()) {
|
if (!manualResizeRedactionEntities.isEmpty() && fileStatus.isExcludedFromAutomaticAnalysis()) {
|
||||||
ManualRedactions manualRedactions = ManualRedactions.builder().resizeRedactions(convertResizeRedactions(manualResizeRedactionEntities)).build();
|
ManualRedactions manualRedactions = ManualRedactions.builder().resizeRedactions(convertResizeRedactions(manualResizeRedactionEntities))
|
||||||
|
.build();
|
||||||
entityLogMergeService.sendToAnalyseQueue(fileId, dossierPersistenceService.getAndValidateDossier(dossierId), fileStatusService.getStatus(fileId), manualRedactions);
|
entityLogMergeService.sendToAnalyseQueue(fileId, dossierPersistenceService.getAndValidateDossier(dossierId), fileStatusService.getStatus(fileId), manualRedactions);
|
||||||
} else {
|
} else {
|
||||||
reprocess(dossierId, fileId);
|
reprocess(dossierId, fileId);
|
||||||
@ -301,14 +324,20 @@ public class ManualRedactionService {
|
|||||||
|
|
||||||
private Set<ManualResizeRedaction> convertResizeRedactions(List<ManualResizeRedactionEntity> source) {
|
private Set<ManualResizeRedaction> convertResizeRedactions(List<ManualResizeRedactionEntity> source) {
|
||||||
|
|
||||||
return source.stream().map(entry -> convert(entry, ManualResizeRedaction.class, new ManualResizeRedactionMapper())).collect(Collectors.toSet());
|
return source.stream()
|
||||||
|
.map(entry -> convert(entry, ManualResizeRedaction.class, new ManualResizeRedactionMapper()))
|
||||||
|
.collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void validatePositions(String fileId, AddRedactionRequest addRedactionRequest) {
|
private void validatePositions(String fileId, AddRedactionRequest addRedactionRequest) {
|
||||||
|
|
||||||
var numberOfPages = fileStatusService.getStatus(fileId).getNumberOfPages();
|
var numberOfPages = fileStatusService.getStatus(fileId).getNumberOfPages();
|
||||||
addRedactionRequest.getPositions().stream().filter(p -> p.getPage() > numberOfPages).findAny().ifPresent(p -> new BadRequestException("Invalid page found in the request"));
|
addRedactionRequest.getPositions()
|
||||||
|
.stream()
|
||||||
|
.filter(p -> p.getPage() > numberOfPages)
|
||||||
|
.findAny()
|
||||||
|
.ifPresent(p -> new BadRequestException("Invalid page found in the request"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -340,42 +369,48 @@ public class ManualRedactionService {
|
|||||||
if (manualRedactions != null) {
|
if (manualRedactions != null) {
|
||||||
|
|
||||||
if (manualRedactions.getEntriesToAdd() != null) {
|
if (manualRedactions.getEntriesToAdd() != null) {
|
||||||
manualRedactions.getEntriesToAdd().forEach(e -> {
|
manualRedactions.getEntriesToAdd()
|
||||||
|
.forEach(e -> {
|
||||||
if (e.getProcessedDate() == null) {
|
if (e.getProcessedDate() == null) {
|
||||||
addRedactionPersistenceService.markAsProcessed(e);
|
addRedactionPersistenceService.markAsProcessed(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (manualRedactions.getIdsToRemove() != null) {
|
if (manualRedactions.getIdsToRemove() != null) {
|
||||||
manualRedactions.getIdsToRemove().forEach(e -> {
|
manualRedactions.getIdsToRemove()
|
||||||
|
.forEach(e -> {
|
||||||
if (e.getProcessedDate() == null) {
|
if (e.getProcessedDate() == null) {
|
||||||
removeRedactionPersistenceService.markAsProcessed(e);
|
removeRedactionPersistenceService.markAsProcessed(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (manualRedactions.getForceRedactions() != null) {
|
if (manualRedactions.getForceRedactions() != null) {
|
||||||
manualRedactions.getForceRedactions().forEach(e -> {
|
manualRedactions.getForceRedactions()
|
||||||
|
.forEach(e -> {
|
||||||
if (e.getProcessedDate() == null) {
|
if (e.getProcessedDate() == null) {
|
||||||
forceRedactionPersistenceService.markAsProcessed(e.getAnnotationId(), e.getFileId());
|
forceRedactionPersistenceService.markAsProcessed(e.getAnnotationId(), e.getFileId());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (manualRedactions.getRecategorizations() != null) {
|
if (manualRedactions.getRecategorizations() != null) {
|
||||||
manualRedactions.getRecategorizations().forEach(e -> {
|
manualRedactions.getRecategorizations()
|
||||||
|
.forEach(e -> {
|
||||||
if (e.getProcessedDate() == null) {
|
if (e.getProcessedDate() == null) {
|
||||||
recategorizationPersistenceService.markAsProcessed(e.getAnnotationId(), e.getFileId());
|
recategorizationPersistenceService.markAsProcessed(e.getAnnotationId(), e.getFileId());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (manualRedactions.getResizeRedactions() != null) {
|
if (manualRedactions.getResizeRedactions() != null) {
|
||||||
manualRedactions.getResizeRedactions().forEach(e -> {
|
manualRedactions.getResizeRedactions()
|
||||||
|
.forEach(e -> {
|
||||||
if (e.getProcessedDate() == null) {
|
if (e.getProcessedDate() == null) {
|
||||||
resizeRedactionPersistenceService.markAsProcessed(e.getAnnotationId(), e.getFileId());
|
resizeRedactionPersistenceService.markAsProcessed(e.getAnnotationId(), e.getFileId());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (manualRedactions.getLegalBasisChanges() != null) {
|
if (manualRedactions.getLegalBasisChanges() != null) {
|
||||||
manualRedactions.getLegalBasisChanges().forEach(e -> {
|
manualRedactions.getLegalBasisChanges()
|
||||||
|
.forEach(e -> {
|
||||||
if (e.getProcessedDate() == null) {
|
if (e.getProcessedDate() == null) {
|
||||||
legalBasisChangePersistenceService.markAsProcessed(e.getAnnotationId(), e.getFileId());
|
legalBasisChangePersistenceService.markAsProcessed(e.getAnnotationId(), e.getFileId());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,21 +28,18 @@ public class RecategorizationPersistenceService {
|
|||||||
|
|
||||||
public void insert(String fileId, RecategorizationRequest recategorizationRequest) {
|
public void insert(String fileId, RecategorizationRequest recategorizationRequest) {
|
||||||
|
|
||||||
ManualRecategorizationEntity manualImageRecategorization = new ManualRecategorizationEntity();
|
ManualRecategorizationEntity manualRecategorization = new ManualRecategorizationEntity();
|
||||||
manualImageRecategorization.setId(new AnnotationEntityId(recategorizationRequest.getAnnotationId(), fileId));
|
manualRecategorization.setId(new AnnotationEntityId(recategorizationRequest.getAnnotationId(), fileId));
|
||||||
BeanUtils.copyProperties(recategorizationRequest, manualImageRecategorization);
|
BeanUtils.copyProperties(recategorizationRequest, manualRecategorization);
|
||||||
manualImageRecategorization.setRequestDate(OffsetDateTime.now());
|
manualRecategorization.setRequestDate(OffsetDateTime.now());
|
||||||
manualImageRecategorization.setTypeId(recategorizationRequest.getDossierTemplateTypeId());
|
manualRecategorization.setTypeId(recategorizationRequest.getDossierTemplateTypeId());
|
||||||
recategorizationRepository.saveAndFlush(manualImageRecategorization);
|
recategorizationRepository.saveAndFlush(manualRecategorization);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updateModifiedDictionaries(String fileId,
|
public void updateModifiedDictionaries(String fileId, String annotationId, Set<String> typeIdsOfDictionaryWithAdd, Set<String> typeIdsOfDictionaryWithDelete) {
|
||||||
String annotationId, Set<String> typeIdsOfDictionaryWithAdd,
|
|
||||||
Set<String> typeIdsOfDictionaryWithDelete) {
|
|
||||||
|
|
||||||
ManualRecategorizationEntity addRedaction = recategorizationRepository.findById(new AnnotationEntityId(annotationId, fileId))
|
ManualRecategorizationEntity addRedaction = recategorizationRepository.findById(new AnnotationEntityId(annotationId, fileId))
|
||||||
.orElseThrow(() -> new NotFoundException("Unknown file/annotation combination: " + fileId + "/" + annotationId));
|
.orElseThrow(() -> new NotFoundException("Unknown file/annotation combination: " + fileId + "/" + annotationId));
|
||||||
|
|||||||
@ -416,7 +416,7 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
|||||||
.build()));
|
.build()));
|
||||||
manualRedactionClient.recategorizeBulk(dossierId,
|
manualRedactionClient.recategorizeBulk(dossierId,
|
||||||
fileId,
|
fileId,
|
||||||
Set.of(RecategorizationRequestModel.builder().annotationId(annotationId).comment("comment").type("new-type")
|
Set.of(RecategorizationRequestModel.builder().annotationId(annotationId).comment("comment").type("new-type").legalBasis("")
|
||||||
.build()),
|
.build()),
|
||||||
false);
|
false);
|
||||||
|
|
||||||
@ -424,22 +424,22 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
|||||||
|
|
||||||
fileManagementClient.deleteFile(dossier.getId(), file.getId());
|
fileManagementClient.deleteFile(dossier.getId(), file.getId());
|
||||||
var softDeletedFiles = fileClient.getSoftDeletedDossierStatus(dossier.getId());
|
var softDeletedFiles = fileClient.getSoftDeletedDossierStatus(dossier.getId());
|
||||||
assertThat(softDeletedFiles.size()).isEqualTo(1);
|
assertThat(softDeletedFiles).hasSize(1);
|
||||||
var activeFiles = fileClient.getDossierStatus(dossier.getId());
|
var activeFiles = fileClient.getDossierStatus(dossier.getId());
|
||||||
assertThat(activeFiles.size()).isEqualTo(0);
|
assertThat(activeFiles).isEmpty();
|
||||||
|
|
||||||
fileManagementClient.restoreFiles(dossier.getId(), Sets.newHashSet(file.getId()));
|
fileManagementClient.restoreFiles(dossier.getId(), Sets.newHashSet(file.getId()));
|
||||||
softDeletedFiles = fileClient.getSoftDeletedDossierStatus(dossier.getId());
|
softDeletedFiles = fileClient.getSoftDeletedDossierStatus(dossier.getId());
|
||||||
assertThat(softDeletedFiles.size()).isEqualTo(0);
|
assertThat(softDeletedFiles).isEmpty();
|
||||||
activeFiles = fileClient.getDossierStatus(dossier.getId());
|
activeFiles = fileClient.getDossierStatus(dossier.getId());
|
||||||
assertThat(activeFiles.size()).isEqualTo(1);
|
assertThat(activeFiles).hasSize(1);
|
||||||
|
|
||||||
fileManagementClient.hardDeleteFiles(dossier.getId(), List.of(file.getId()));
|
fileManagementClient.hardDeleteFiles(dossier.getId(), List.of(file.getId()));
|
||||||
softDeletedFiles = fileClient.getSoftDeletedDossierStatus(dossier.getId());
|
softDeletedFiles = fileClient.getSoftDeletedDossierStatus(dossier.getId());
|
||||||
assertThat(softDeletedFiles.size()).isEqualTo(0);
|
assertThat(softDeletedFiles).isEmpty();
|
||||||
|
|
||||||
activeFiles = fileClient.getDossierStatus(dossier.getId());
|
activeFiles = fileClient.getDossierStatus(dossier.getId());
|
||||||
assertThat(activeFiles.size()).isEqualTo(0);
|
assertThat(activeFiles).isEmpty();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user