|
|
|
|
@ -1,5 +1,12 @@
|
|
|
|
|
package com.iqser.red.service.peristence.v1.server.integration.tests;
|
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
|
|
import com.iqser.red.service.peristence.v1.server.integration.client.DictionaryClient;
|
|
|
|
|
import com.iqser.red.service.peristence.v1.server.integration.client.ManualRedactionClient;
|
|
|
|
|
import com.iqser.red.service.peristence.v1.server.integration.service.DossierTemplateTesterAndProvider;
|
|
|
|
|
@ -7,15 +14,17 @@ import com.iqser.red.service.peristence.v1.server.integration.service.DossierTes
|
|
|
|
|
import com.iqser.red.service.peristence.v1.server.integration.service.FileTesterAndProvider;
|
|
|
|
|
import com.iqser.red.service.peristence.v1.server.integration.service.TypeProvider;
|
|
|
|
|
import com.iqser.red.service.peristence.v1.server.integration.utils.AbstractPersistenceServerServiceTest;
|
|
|
|
|
import com.iqser.red.service.persistence.service.v1.api.model.annotations.*;
|
|
|
|
|
import com.iqser.red.service.persistence.service.v1.api.model.annotations.AddRedactionRequest;
|
|
|
|
|
import com.iqser.red.service.persistence.service.v1.api.model.annotations.AnnotationStatus;
|
|
|
|
|
import com.iqser.red.service.persistence.service.v1.api.model.annotations.CommentRequest;
|
|
|
|
|
import com.iqser.red.service.persistence.service.v1.api.model.annotations.ForceRedactionRequest;
|
|
|
|
|
import com.iqser.red.service.persistence.service.v1.api.model.annotations.ImageRecategorizationRequest;
|
|
|
|
|
import com.iqser.red.service.persistence.service.v1.api.model.annotations.LegalBasisChangeRequest;
|
|
|
|
|
import com.iqser.red.service.persistence.service.v1.api.model.annotations.ManualRedactions;
|
|
|
|
|
import com.iqser.red.service.persistence.service.v1.api.model.annotations.Rectangle;
|
|
|
|
|
import com.iqser.red.service.persistence.service.v1.api.model.annotations.RemoveRedactionRequest;
|
|
|
|
|
import com.iqser.red.service.persistence.service.v1.api.model.annotations.ResizeRedactionRequest;
|
|
|
|
|
import com.iqser.red.service.persistence.service.v1.api.model.common.JSONPrimitive;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
|
import static org.assertj.core.api.Assertions.entry;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|
|
|
|
|
|
|
|
|
@ -37,6 +46,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|
|
|
|
@Autowired
|
|
|
|
|
private DictionaryClient dictionaryClient;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testManualRedaction() {
|
|
|
|
|
|
|
|
|
|
@ -48,21 +58,29 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|
|
|
|
|
|
|
|
|
var type = typeProvider.testAndProvideType(dossierTemplate, null, "manual");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var comment = manualRedactionClient.addComment(dossier.getId(), file.getId(), "1", CommentRequest.builder().text("test").user("1").build());
|
|
|
|
|
var comment = manualRedactionClient.addComment(dossier.getId(), file.getId(), "1", CommentRequest.builder()
|
|
|
|
|
.text("test")
|
|
|
|
|
.user("1")
|
|
|
|
|
.build());
|
|
|
|
|
var loadedComment = manualRedactionClient.getComment(comment.getId());
|
|
|
|
|
assertThat(loadedComment.getText()).isEqualTo("test");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var addRedaction = manualRedactionClient.addAddRedaction(dossier.getId(), file.getId(), AddRedactionRequest.builder()
|
|
|
|
|
.positions(List.of(Rectangle.builder().topLeftY(1).topLeftX(1).height(1).width(1).build()))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.section("section test")
|
|
|
|
|
.addToDictionary(true)
|
|
|
|
|
.addToDossierDictionary(false).status(AnnotationStatus.REQUESTED).typeId(type.getId()).user("user").reason("1").value("test").legalBasis("1").build());
|
|
|
|
|
.addToDossierDictionary(false)
|
|
|
|
|
.status(AnnotationStatus.REQUESTED)
|
|
|
|
|
.typeId(type.getId())
|
|
|
|
|
.user("user")
|
|
|
|
|
.reason("1")
|
|
|
|
|
.value("test")
|
|
|
|
|
.legalBasis("1")
|
|
|
|
|
.build());
|
|
|
|
|
var loadedAddRedaction = manualRedactionClient.getAddRedaction(file.getId(), addRedaction.getAnnotationId());
|
|
|
|
|
assertThat(loadedAddRedaction.getUser()).isEqualTo("user");
|
|
|
|
|
assertThat(loadedAddRedaction.getType()).contains("manual");
|
|
|
|
|
assertThat(loadedAddRedaction.getSection()).contains("section test");
|
|
|
|
|
|
|
|
|
|
manualRedactionClient.updateAddRedactionStatus(dossier.getId(), file.getId(), addRedaction.getAnnotationId(), JSONPrimitive.of(AnnotationStatus.APPROVED));
|
|
|
|
|
loadedAddRedaction = manualRedactionClient.getAddRedaction(file.getId(), addRedaction.getAnnotationId());
|
|
|
|
|
@ -72,18 +90,33 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|
|
|
|
loadedAddRedaction = manualRedactionClient.getAddRedaction(file.getId(), addRedaction.getAnnotationId());
|
|
|
|
|
assertThat(loadedAddRedaction.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
|
|
|
|
|
|
|
|
|
var addRedaction2 = manualRedactionClient.addAddRedaction(dossier.getId(), file.getId(), AddRedactionRequest.builder().addToDictionary(true)
|
|
|
|
|
.addToDossierDictionary(false).status(AnnotationStatus.APPROVED).typeId(type.getId()).user("user").reason("1").value("test").legalBasis("1").comment("comment").build());
|
|
|
|
|
var addRedaction2 = manualRedactionClient.addAddRedaction(dossier.getId(), file.getId(), AddRedactionRequest.builder()
|
|
|
|
|
.addToDictionary(true)
|
|
|
|
|
.addToDossierDictionary(false)
|
|
|
|
|
.status(AnnotationStatus.APPROVED)
|
|
|
|
|
.typeId(type.getId())
|
|
|
|
|
.user("user")
|
|
|
|
|
.reason("1")
|
|
|
|
|
.value("test")
|
|
|
|
|
.legalBasis("1")
|
|
|
|
|
.comment("comment")
|
|
|
|
|
.section("section2")
|
|
|
|
|
.build());
|
|
|
|
|
|
|
|
|
|
manualRedactionClient.updateAddRedactionStatus(dossier.getId(), file.getId(), addRedaction2.getAnnotationId(), JSONPrimitive.of(AnnotationStatus.REQUESTED));
|
|
|
|
|
var loadedAddRedaction2 = manualRedactionClient.getAddRedaction(file.getId(), addRedaction2.getAnnotationId());
|
|
|
|
|
assertThat(loadedAddRedaction2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
|
|
|
|
assertThat(loadedAddRedaction2.isAddToDossierDictionary()).isEqualTo(false);
|
|
|
|
|
assertThat(loadedAddRedaction2.isAddToDictionary()).isEqualTo(true);
|
|
|
|
|
|
|
|
|
|
assertThat(loadedAddRedaction2.getSection()).contains("section2");
|
|
|
|
|
|
|
|
|
|
var removeRedaction = manualRedactionClient.addRemoveRedaction(dossier.getId(), file.getId(), RemoveRedactionRequest.builder()
|
|
|
|
|
.annotationId(addRedaction.getAnnotationId()).comment("comment").status(AnnotationStatus.REQUESTED).user("test").removeFromDictionary(false).build());
|
|
|
|
|
.annotationId(addRedaction.getAnnotationId())
|
|
|
|
|
.comment("comment")
|
|
|
|
|
.status(AnnotationStatus.REQUESTED)
|
|
|
|
|
.user("test")
|
|
|
|
|
.removeFromDictionary(false)
|
|
|
|
|
.build());
|
|
|
|
|
manualRedactionClient.updateRemoveRedactionStatus(dossier.getId(), file.getId(), removeRedaction.getAnnotationId(), JSONPrimitive.of(AnnotationStatus.REQUESTED));
|
|
|
|
|
var loadedRemoveRedaction = manualRedactionClient.getRemoveRedaction(file.getId(), removeRedaction.getAnnotationId());
|
|
|
|
|
assertThat(loadedRemoveRedaction.isRemoveFromDictionary()).isEqualTo(false);
|
|
|
|
|
@ -98,7 +131,12 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|
|
|
|
assertThat(loadedRemoveRedaction.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
|
|
|
|
|
|
|
|
|
var removeRedaction2 = manualRedactionClient.addRemoveRedaction(dossier.getId(), file.getId(), RemoveRedactionRequest.builder()
|
|
|
|
|
.annotationId("annotationId").comment("comment").status(AnnotationStatus.APPROVED).user("test").removeFromDictionary(true).build());
|
|
|
|
|
.annotationId("annotationId")
|
|
|
|
|
.comment("comment")
|
|
|
|
|
.status(AnnotationStatus.APPROVED)
|
|
|
|
|
.user("test")
|
|
|
|
|
.removeFromDictionary(true)
|
|
|
|
|
.build());
|
|
|
|
|
manualRedactionClient.updateRemoveRedactionStatus(dossier.getId(), file.getId(), removeRedaction2.getAnnotationId(), JSONPrimitive.of(AnnotationStatus.REQUESTED));
|
|
|
|
|
var loadedRemoveRedaction2 = manualRedactionClient.getRemoveRedaction(file.getId(), removeRedaction2.getAnnotationId());
|
|
|
|
|
assertThat(loadedRemoveRedaction2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
|
|
|
|
@ -113,9 +151,13 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|
|
|
|
loadedRemoveRedaction2 = manualRedactionClient.getRemoveRedaction(file.getId(), removeRedaction2.getAnnotationId());
|
|
|
|
|
assertThat(loadedRemoveRedaction2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var forceRedaction = manualRedactionClient.addForceRedaction(dossier.getId(), file.getId(), ForceRedactionRequest.builder()
|
|
|
|
|
.annotationId(addRedaction.getAnnotationId()).comment("comment").status(AnnotationStatus.REQUESTED).user("test").legalBasis("1").build());
|
|
|
|
|
.annotationId(addRedaction.getAnnotationId())
|
|
|
|
|
.comment("comment")
|
|
|
|
|
.status(AnnotationStatus.REQUESTED)
|
|
|
|
|
.user("test")
|
|
|
|
|
.legalBasis("1")
|
|
|
|
|
.build());
|
|
|
|
|
var loadedForceRedaction = manualRedactionClient.getForceRedaction(file.getId(), forceRedaction.getAnnotationId());
|
|
|
|
|
assertThat(loadedForceRedaction.getLegalBasis()).isEqualTo("1");
|
|
|
|
|
assertThat(loadedForceRedaction.getUser()).isEqualTo("test");
|
|
|
|
|
@ -130,9 +172,13 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|
|
|
|
loadedForceRedaction = manualRedactionClient.getForceRedaction(file.getId(), addRedaction.getAnnotationId());
|
|
|
|
|
assertThat(loadedForceRedaction.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var legalBasisChange = manualRedactionClient.addLegalBasisChange(dossier.getId(), file.getId(), LegalBasisChangeRequest.builder()
|
|
|
|
|
.annotationId(addRedaction.getAnnotationId()).comment("comment").status(AnnotationStatus.REQUESTED).user("test").legalBasis("1").build());
|
|
|
|
|
.annotationId(addRedaction.getAnnotationId())
|
|
|
|
|
.comment("comment")
|
|
|
|
|
.status(AnnotationStatus.REQUESTED)
|
|
|
|
|
.user("test")
|
|
|
|
|
.legalBasis("1")
|
|
|
|
|
.build());
|
|
|
|
|
var loadedLegalBasisChange = manualRedactionClient.getLegalBasisChange(file.getId(), addRedaction.getAnnotationId());
|
|
|
|
|
assertThat(loadedLegalBasisChange.getAnnotationId()).isEqualTo(legalBasisChange.getAnnotationId());
|
|
|
|
|
assertThat(loadedLegalBasisChange.getUser()).isEqualTo("test");
|
|
|
|
|
@ -146,9 +192,13 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|
|
|
|
loadedLegalBasisChange = manualRedactionClient.getLegalBasisChange(file.getId(), addRedaction.getAnnotationId());
|
|
|
|
|
assertThat(loadedLegalBasisChange.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var imageRecategorization = manualRedactionClient.addImageRecategorization(dossier.getId(), file.getId(), ImageRecategorizationRequest.builder()
|
|
|
|
|
.annotationId(addRedaction.getAnnotationId()).comment("comment").status(AnnotationStatus.REQUESTED).user("test").typeId("new-type:id").build());
|
|
|
|
|
.annotationId(addRedaction.getAnnotationId())
|
|
|
|
|
.comment("comment")
|
|
|
|
|
.status(AnnotationStatus.REQUESTED)
|
|
|
|
|
.user("test")
|
|
|
|
|
.typeId("new-type:id")
|
|
|
|
|
.build());
|
|
|
|
|
var loadedImageRecategorization = manualRedactionClient.getImageRecategorization(file.getId(), addRedaction.getAnnotationId());
|
|
|
|
|
assertThat(loadedImageRecategorization.getAnnotationId()).isEqualTo(imageRecategorization.getAnnotationId());
|
|
|
|
|
|
|
|
|
|
@ -161,7 +211,12 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|
|
|
|
assertThat(loadedImageRecategorization.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
|
|
|
|
|
|
|
|
|
var imageRecategorization2 = manualRedactionClient.addImageRecategorization(dossier.getId(), file.getId(), ImageRecategorizationRequest.builder()
|
|
|
|
|
.annotationId(addRedaction2.getAnnotationId()).comment("comment").status(AnnotationStatus.APPROVED).user("test").typeId("new-type:id").build());
|
|
|
|
|
.annotationId(addRedaction2.getAnnotationId())
|
|
|
|
|
.comment("comment")
|
|
|
|
|
.status(AnnotationStatus.APPROVED)
|
|
|
|
|
.user("test")
|
|
|
|
|
.typeId("new-type:id")
|
|
|
|
|
.build());
|
|
|
|
|
var loadedImageRecategorization2 = manualRedactionClient.getImageRecategorization(file.getId(), imageRecategorization2.getAnnotationId());
|
|
|
|
|
assertThat(loadedImageRecategorization2.getStatus()).isEqualTo(AnnotationStatus.APPROVED);
|
|
|
|
|
|
|
|
|
|
@ -170,7 +225,14 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|
|
|
|
assertThat(loadedImageRecategorization2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
|
|
|
|
|
|
|
|
|
var resizeRedaction = manualRedactionClient.addResizeRedaction(dossier.getId(), file.getId(), ResizeRedactionRequest.builder()
|
|
|
|
|
.annotationId(addRedaction.getAnnotationId()).page(1).comment("comment").status(AnnotationStatus.REQUESTED).positions(List.of(Rectangle.builder().topLeftY(2).topLeftX(2).height(2).width(2).build())).user("test").value("some value").build());
|
|
|
|
|
.annotationId(addRedaction.getAnnotationId())
|
|
|
|
|
.page(1)
|
|
|
|
|
.comment("comment")
|
|
|
|
|
.status(AnnotationStatus.REQUESTED)
|
|
|
|
|
.positions(List.of(Rectangle.builder().topLeftY(2).topLeftX(2).height(2).width(2).build()))
|
|
|
|
|
.user("test")
|
|
|
|
|
.value("some value")
|
|
|
|
|
.build());
|
|
|
|
|
var loadedResizeRedaction = manualRedactionClient.getResizeRedaction(file.getId(), resizeRedaction.getAnnotationId());
|
|
|
|
|
assertThat(loadedResizeRedaction.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
|
|
|
|
assertThat(loadedResizeRedaction.getUser()).isEqualTo("test");
|
|
|
|
|
@ -185,7 +247,6 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|
|
|
|
loadedResizeRedaction = manualRedactionClient.getResizeRedaction(file.getId(), resizeRedaction.getAnnotationId());
|
|
|
|
|
assertThat(loadedResizeRedaction.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ManualRedactions manualRedactions = manualRedactionClient.getManualRedactions(dossier.getId(), file.getId());
|
|
|
|
|
assertThat(manualRedactions.getForceRedactions()).isNotEmpty();
|
|
|
|
|
assertThat(manualRedactions.getLegalBasisChanges()).isNotEmpty();
|
|
|
|
|
@ -195,33 +256,47 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|
|
|
|
assertThat(manualRedactions.getComments()).isNotEmpty();
|
|
|
|
|
assertThat(manualRedactions.getResizeRedactions()).isNotEmpty();
|
|
|
|
|
|
|
|
|
|
manualRedactions.getForceRedactions()
|
|
|
|
|
.forEach(e -> manualRedactionClient.deleteForceRedaction(dossier.getId(), file.getId(), e.getAnnotationId()));
|
|
|
|
|
manualRedactions.getLegalBasisChanges()
|
|
|
|
|
.forEach(e -> manualRedactionClient.deleteLegalBasisChange(dossier.getId(), file.getId(), e.getAnnotationId()));
|
|
|
|
|
manualRedactions.getEntriesToAdd()
|
|
|
|
|
.forEach(e -> manualRedactionClient.deleteAddRedaction(dossier.getId(), file.getId(), e.getAnnotationId()));
|
|
|
|
|
manualRedactions.getIdsToRemove()
|
|
|
|
|
.forEach(e -> manualRedactionClient.deleteRemoveRedaction(dossier.getId(), file.getId(), e.getAnnotationId()));
|
|
|
|
|
manualRedactions.getImageRecategorization()
|
|
|
|
|
.forEach(e -> manualRedactionClient.deleteImageRecategorization(dossier.getId(), file.getId(), e.getAnnotationId()));
|
|
|
|
|
manualRedactions.getResizeRedactions()
|
|
|
|
|
.forEach(e -> manualRedactionClient.deleteResizeRedaction(dossier.getId(), file.getId(), e.getAnnotationId()));
|
|
|
|
|
|
|
|
|
|
manualRedactions.getForceRedactions().forEach(e -> manualRedactionClient.deleteForceRedaction(dossier.getId(), file.getId(), e.getAnnotationId()));
|
|
|
|
|
manualRedactions.getLegalBasisChanges().forEach(e -> manualRedactionClient.deleteLegalBasisChange(dossier.getId(), file.getId(), e.getAnnotationId()));
|
|
|
|
|
manualRedactions.getEntriesToAdd().forEach(e -> manualRedactionClient.deleteAddRedaction(dossier.getId(), file.getId(), e.getAnnotationId()));
|
|
|
|
|
manualRedactions.getIdsToRemove().forEach(e -> manualRedactionClient.deleteRemoveRedaction(dossier.getId(), file.getId(), e.getAnnotationId()));
|
|
|
|
|
manualRedactions.getImageRecategorization().forEach(e -> manualRedactionClient.deleteImageRecategorization(dossier.getId(), file.getId(), e.getAnnotationId()));
|
|
|
|
|
manualRedactions.getResizeRedactions().forEach(e -> manualRedactionClient.deleteResizeRedaction(dossier.getId(), file.getId(), e.getAnnotationId()));
|
|
|
|
|
|
|
|
|
|
manualRedactions.getComments().forEach((key, value) -> value.forEach(c -> manualRedactionClient.deleteComment(file.getId(), c.getId())));
|
|
|
|
|
|
|
|
|
|
manualRedactions.getComments()
|
|
|
|
|
.forEach((key, value) -> value.forEach(c -> manualRedactionClient.deleteComment(file.getId(), c.getId())));
|
|
|
|
|
|
|
|
|
|
var forceRedaction2 = manualRedactionClient.addForceRedaction(dossier.getId(), file.getId(), ForceRedactionRequest.builder()
|
|
|
|
|
.annotationId(addRedaction2.getAnnotationId()).comment("comment").status(AnnotationStatus.APPROVED).user("test").legalBasis("1").build());
|
|
|
|
|
.annotationId(addRedaction2.getAnnotationId())
|
|
|
|
|
.comment("comment")
|
|
|
|
|
.status(AnnotationStatus.APPROVED)
|
|
|
|
|
.user("test")
|
|
|
|
|
.legalBasis("1")
|
|
|
|
|
.build());
|
|
|
|
|
var loadedForceRedaction2 = manualRedactionClient.getForceRedaction(file.getId(), forceRedaction2.getAnnotationId());
|
|
|
|
|
assertThat(loadedForceRedaction2.getStatus()).isEqualTo(AnnotationStatus.APPROVED);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
manualRedactionClient.updateForceRedactionStatus(dossier.getId(), file.getId(), forceRedaction2.getAnnotationId(), JSONPrimitive.of(AnnotationStatus.REQUESTED));
|
|
|
|
|
loadedForceRedaction2 = manualRedactionClient.getForceRedaction(file.getId(), forceRedaction2.getAnnotationId());
|
|
|
|
|
assertThat(loadedForceRedaction2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
|
|
|
|
|
|
|
|
|
manualRedactions = manualRedactionClient.getManualRedactions(dossier.getId(), file.getId());
|
|
|
|
|
manualRedactions.getForceRedactions().forEach(e -> manualRedactionClient.deleteForceRedaction(dossier.getId(), file.getId(), e.getAnnotationId()));
|
|
|
|
|
|
|
|
|
|
manualRedactions.getForceRedactions()
|
|
|
|
|
.forEach(e -> manualRedactionClient.deleteForceRedaction(dossier.getId(), file.getId(), e.getAnnotationId()));
|
|
|
|
|
|
|
|
|
|
var legalBasisChange2 = manualRedactionClient.addLegalBasisChange(dossier.getId(), file.getId(), LegalBasisChangeRequest.builder()
|
|
|
|
|
.annotationId(addRedaction2.getAnnotationId()).comment("comment").status(AnnotationStatus.APPROVED).user("test").legalBasis("1").build());
|
|
|
|
|
.annotationId(addRedaction2.getAnnotationId())
|
|
|
|
|
.comment("comment")
|
|
|
|
|
.status(AnnotationStatus.APPROVED)
|
|
|
|
|
.user("test")
|
|
|
|
|
.legalBasis("1")
|
|
|
|
|
.build());
|
|
|
|
|
var loadedLegalBasisChange2 = manualRedactionClient.getLegalBasisChange(file.getId(), legalBasisChange2.getAnnotationId());
|
|
|
|
|
assertThat(loadedLegalBasisChange2.getStatus()).isEqualTo(AnnotationStatus.APPROVED);
|
|
|
|
|
|
|
|
|
|
@ -230,10 +305,18 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|
|
|
|
assertThat(loadedLegalBasisChange2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
|
|
|
|
|
|
|
|
|
manualRedactions = manualRedactionClient.getManualRedactions(dossier.getId(), file.getId());
|
|
|
|
|
manualRedactions.getLegalBasisChanges().forEach(e -> manualRedactionClient.deleteLegalBasisChange(dossier.getId(), file.getId(), e.getAnnotationId()));
|
|
|
|
|
manualRedactions.getLegalBasisChanges()
|
|
|
|
|
.forEach(e -> manualRedactionClient.deleteLegalBasisChange(dossier.getId(), file.getId(), e.getAnnotationId()));
|
|
|
|
|
|
|
|
|
|
var resizeRedaction2 = manualRedactionClient.addResizeRedaction(dossier.getId(), file.getId(), ResizeRedactionRequest.builder()
|
|
|
|
|
.annotationId(addRedaction.getAnnotationId()).page(1).comment("comment").status(AnnotationStatus.APPROVED).positions(List.of(Rectangle.builder().topLeftY(2).topLeftX(2).height(2).width(2).build())).user("test").value("some value").build());
|
|
|
|
|
.annotationId(addRedaction.getAnnotationId())
|
|
|
|
|
.page(1)
|
|
|
|
|
.comment("comment")
|
|
|
|
|
.status(AnnotationStatus.APPROVED)
|
|
|
|
|
.positions(List.of(Rectangle.builder().topLeftY(2).topLeftX(2).height(2).width(2).build()))
|
|
|
|
|
.user("test")
|
|
|
|
|
.value("some value")
|
|
|
|
|
.build());
|
|
|
|
|
var loadedResizeRedaction2 = manualRedactionClient.getResizeRedaction(file.getId(), resizeRedaction2.getAnnotationId());
|
|
|
|
|
assertThat(loadedResizeRedaction2.getStatus()).isEqualTo(AnnotationStatus.APPROVED);
|
|
|
|
|
assertThat(loadedResizeRedaction2.getUser()).isEqualTo("test");
|
|
|
|
|
@ -245,4 +328,5 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|
|
|
|
assertThat(loadedResizeRedaction2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|