RED-7317: Endpoint to change entity types of dict-based annotations
* fix tests
This commit is contained in:
parent
80e602fb07
commit
d40ef63116
@ -111,14 +111,14 @@ public class ManualRedactionDictionaryUpdateHandler {
|
|||||||
Set<String> typeIdsOfModifiedDictionaries = new HashSet<>();
|
Set<String> typeIdsOfModifiedDictionaries = new HashSet<>();
|
||||||
if (manualRequestWithRemoveFromDictionary.isRemoveFromAllDossiers()) {
|
if (manualRequestWithRemoveFromDictionary.isRemoveFromAllDossiers()) {
|
||||||
var dictionaryEntriesToRemove = dictionaryManagementService.getAllEntriesInDossierTemplate(toTypeId(redactionLogEntry.getType(), dossierTemplateId),
|
var dictionaryEntriesToRemove = dictionaryManagementService.getAllEntriesInDossierTemplate(toTypeId(redactionLogEntry.getType(), dossierTemplateId),
|
||||||
redactionLogEntry.getValue(), DictionaryEntryType.ENTRY);
|
redactionLogEntry.getValue(), getDictionaryEntryType(redactionLogEntry));
|
||||||
dictionaryEntriesToRemove.forEach(entry -> {
|
dictionaryEntriesToRemove.forEach(entry -> {
|
||||||
typeIdsOfModifiedDictionaries.add(entry.getTypeId());
|
typeIdsOfModifiedDictionaries.add(entry.getTypeId());
|
||||||
removeFromDictionary(entry.getTypeId(), entry.getValue(), dossierId, fileId, DictionaryEntryType.ENTRY);
|
removeFromDictionary(entry.getTypeId(), entry.getValue(), dossierId, fileId, getDictionaryEntryType(redactionLogEntry));
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
typeIdsOfModifiedDictionaries.add(toTypeId(redactionLogEntry.getType(), dossierTemplateId, dossierId));
|
typeIdsOfModifiedDictionaries.add(toTypeId(redactionLogEntry.getType(), dossierTemplateId, dossierId));
|
||||||
removeFromDictionary(toTypeId(redactionLogEntry.getType(), dossierTemplateId, dossierId), redactionLogEntry.getValue(), dossierId, fileId, DictionaryEntryType.ENTRY);
|
removeFromDictionary(toTypeId(redactionLogEntry.getType(), dossierTemplateId, dossierId), redactionLogEntry.getValue(), dossierId, fileId, getDictionaryEntryType(redactionLogEntry));
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is needed to remove resizeRedactions with addToDictionary.
|
// This is needed to remove resizeRedactions with addToDictionary.
|
||||||
|
|||||||
@ -52,6 +52,7 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemp
|
|||||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileType;
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileType;
|
||||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.ProcessingStatus;
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.ProcessingStatus;
|
||||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.WorkflowStatus;
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.WorkflowStatus;
|
||||||
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.type.DictionaryEntryType;
|
||||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.manual.AddCommentRequestModel;
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.manual.AddCommentRequestModel;
|
||||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.manual.AddRedactionRequestModel;
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.manual.AddRedactionRequestModel;
|
||||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.manual.ForceRedactionRequestModel;
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.manual.ForceRedactionRequestModel;
|
||||||
@ -371,6 +372,7 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
|||||||
.reason("1")
|
.reason("1")
|
||||||
.value("test")
|
.value("test")
|
||||||
.legalBasis("1")
|
.legalBasis("1")
|
||||||
|
.dictionaryEntryType(DictionaryEntryType.ENTRY)
|
||||||
.build();
|
.build();
|
||||||
manualRedactionClient.addRedactionBulk(dossierId, fileId, Set.of(addRedactionRequest));
|
manualRedactionClient.addRedactionBulk(dossierId, fileId, Set.of(addRedactionRequest));
|
||||||
|
|
||||||
@ -440,6 +442,7 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
|||||||
.reason("1")
|
.reason("1")
|
||||||
.value("test")
|
.value("test")
|
||||||
.legalBasis("1")
|
.legalBasis("1")
|
||||||
|
.dictionaryEntryType(DictionaryEntryType.ENTRY)
|
||||||
.build())).iterator().next();
|
.build())).iterator().next();
|
||||||
|
|
||||||
var loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
var loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user