RED-2633 Added section to manual redactions and extended ManualRedactionTest
This commit is contained in:
parent
906b3c840d
commit
d8ac7a7671
@ -22,6 +22,7 @@ public class AddRedactionRequest {
|
|||||||
private boolean addToDictionary;
|
private boolean addToDictionary;
|
||||||
private boolean addToDossierDictionary;
|
private boolean addToDossierDictionary;
|
||||||
private AnnotationStatus status;
|
private AnnotationStatus status;
|
||||||
|
private String section;
|
||||||
|
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private List<Rectangle> positions = new ArrayList<>();
|
private List<Rectangle> positions = new ArrayList<>();
|
||||||
|
|||||||
@ -17,5 +17,6 @@ public class LegalBasisChangeRequest {
|
|||||||
private String legalBasis;
|
private String legalBasis;
|
||||||
private String comment;
|
private String comment;
|
||||||
private int page;
|
private int page;
|
||||||
|
private String section;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,7 @@ public class ManualLegalBasisChange {
|
|||||||
private String fileId;
|
private String fileId;
|
||||||
private String user;
|
private String user;
|
||||||
private AnnotationStatus status;
|
private AnnotationStatus status;
|
||||||
|
private String section;
|
||||||
private String legalBasis;
|
private String legalBasis;
|
||||||
private OffsetDateTime requestDate;
|
private OffsetDateTime requestDate;
|
||||||
private OffsetDateTime processedDate;
|
private OffsetDateTime processedDate;
|
||||||
|
|||||||
@ -23,6 +23,7 @@ public class ManualRedactionEntry {
|
|||||||
private String reason;
|
private String reason;
|
||||||
private String legalBasis;
|
private String legalBasis;
|
||||||
private AnnotationStatus status;
|
private AnnotationStatus status;
|
||||||
|
private String section;
|
||||||
private boolean addToDictionary;
|
private boolean addToDictionary;
|
||||||
private boolean addToDossierDictionary;
|
private boolean addToDossierDictionary;
|
||||||
private OffsetDateTime requestDate;
|
private OffsetDateTime requestDate;
|
||||||
|
|||||||
@ -27,6 +27,8 @@ public class ManualLegalBasisChangeEntity {
|
|||||||
@Enumerated(EnumType.STRING)
|
@Enumerated(EnumType.STRING)
|
||||||
private AnnotationStatus status;
|
private AnnotationStatus status;
|
||||||
@Column
|
@Column
|
||||||
|
private String section;
|
||||||
|
@Column
|
||||||
private String legalBasis;
|
private String legalBasis;
|
||||||
@Column
|
@Column
|
||||||
private OffsetDateTime requestDate;
|
private OffsetDateTime requestDate;
|
||||||
|
|||||||
@ -36,6 +36,8 @@ public class ManualRedactionEntryEntity {
|
|||||||
@Enumerated(EnumType.STRING)
|
@Enumerated(EnumType.STRING)
|
||||||
private AnnotationStatus status;
|
private AnnotationStatus status;
|
||||||
@Column
|
@Column
|
||||||
|
private String section;
|
||||||
|
@Column
|
||||||
private boolean addToDictionary;
|
private boolean addToDictionary;
|
||||||
@Column
|
@Column
|
||||||
private boolean addToDossierDictionary;
|
private boolean addToDossierDictionary;
|
||||||
|
|||||||
@ -1,5 +1,12 @@
|
|||||||
package com.iqser.red.service.peristence.v1.server.integration.tests;
|
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.DictionaryClient;
|
||||||
import com.iqser.red.service.peristence.v1.server.integration.client.ManualRedactionClient;
|
import com.iqser.red.service.peristence.v1.server.integration.client.ManualRedactionClient;
|
||||||
import com.iqser.red.service.peristence.v1.server.integration.service.DossierTemplateTesterAndProvider;
|
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.FileTesterAndProvider;
|
||||||
import com.iqser.red.service.peristence.v1.server.integration.service.TypeProvider;
|
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.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 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 {
|
public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||||
|
|
||||||
@ -37,6 +46,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DictionaryClient dictionaryClient;
|
private DictionaryClient dictionaryClient;
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testManualRedaction() {
|
public void testManualRedaction() {
|
||||||
|
|
||||||
@ -48,21 +58,29 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|||||||
|
|
||||||
var type = typeProvider.testAndProvideType(dossierTemplate, null, "manual");
|
var type = typeProvider.testAndProvideType(dossierTemplate, null, "manual");
|
||||||
|
|
||||||
|
var comment = manualRedactionClient.addComment(dossier.getId(), file.getId(), "1", CommentRequest.builder()
|
||||||
var comment = manualRedactionClient.addComment(dossier.getId(), file.getId(), "1", CommentRequest.builder().text("test").user("1").build());
|
.text("test")
|
||||||
|
.user("1")
|
||||||
|
.build());
|
||||||
var loadedComment = manualRedactionClient.getComment(comment.getId());
|
var loadedComment = manualRedactionClient.getComment(comment.getId());
|
||||||
assertThat(loadedComment.getText()).isEqualTo("test");
|
assertThat(loadedComment.getText()).isEqualTo("test");
|
||||||
|
|
||||||
|
|
||||||
var addRedaction = manualRedactionClient.addAddRedaction(dossier.getId(), file.getId(), AddRedactionRequest.builder()
|
var addRedaction = manualRedactionClient.addAddRedaction(dossier.getId(), file.getId(), AddRedactionRequest.builder()
|
||||||
.positions(List.of(Rectangle.builder().topLeftY(1).topLeftX(1).height(1).width(1).build()))
|
.positions(List.of(Rectangle.builder().topLeftY(1).topLeftX(1).height(1).width(1).build()))
|
||||||
|
.section("section test")
|
||||||
|
|
||||||
.addToDictionary(true)
|
.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());
|
var loadedAddRedaction = manualRedactionClient.getAddRedaction(file.getId(), addRedaction.getAnnotationId());
|
||||||
assertThat(loadedAddRedaction.getUser()).isEqualTo("user");
|
assertThat(loadedAddRedaction.getUser()).isEqualTo("user");
|
||||||
assertThat(loadedAddRedaction.getType()).contains("manual");
|
assertThat(loadedAddRedaction.getType()).contains("manual");
|
||||||
|
assertThat(loadedAddRedaction.getSection()).contains("section test");
|
||||||
|
|
||||||
manualRedactionClient.updateAddRedactionStatus(dossier.getId(), file.getId(), addRedaction.getAnnotationId(), JSONPrimitive.of(AnnotationStatus.APPROVED));
|
manualRedactionClient.updateAddRedactionStatus(dossier.getId(), file.getId(), addRedaction.getAnnotationId(), JSONPrimitive.of(AnnotationStatus.APPROVED));
|
||||||
loadedAddRedaction = manualRedactionClient.getAddRedaction(file.getId(), addRedaction.getAnnotationId());
|
loadedAddRedaction = manualRedactionClient.getAddRedaction(file.getId(), addRedaction.getAnnotationId());
|
||||||
@ -72,18 +90,33 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|||||||
loadedAddRedaction = manualRedactionClient.getAddRedaction(file.getId(), addRedaction.getAnnotationId());
|
loadedAddRedaction = manualRedactionClient.getAddRedaction(file.getId(), addRedaction.getAnnotationId());
|
||||||
assertThat(loadedAddRedaction.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
assertThat(loadedAddRedaction.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
||||||
|
|
||||||
var addRedaction2 = manualRedactionClient.addAddRedaction(dossier.getId(), file.getId(), AddRedactionRequest.builder().addToDictionary(true)
|
var addRedaction2 = manualRedactionClient.addAddRedaction(dossier.getId(), file.getId(), AddRedactionRequest.builder()
|
||||||
.addToDossierDictionary(false).status(AnnotationStatus.APPROVED).typeId(type.getId()).user("user").reason("1").value("test").legalBasis("1").comment("comment").build());
|
.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));
|
manualRedactionClient.updateAddRedactionStatus(dossier.getId(), file.getId(), addRedaction2.getAnnotationId(), JSONPrimitive.of(AnnotationStatus.REQUESTED));
|
||||||
var loadedAddRedaction2 = manualRedactionClient.getAddRedaction(file.getId(), addRedaction2.getAnnotationId());
|
var loadedAddRedaction2 = manualRedactionClient.getAddRedaction(file.getId(), addRedaction2.getAnnotationId());
|
||||||
assertThat(loadedAddRedaction2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
assertThat(loadedAddRedaction2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
||||||
assertThat(loadedAddRedaction2.isAddToDossierDictionary()).isEqualTo(false);
|
assertThat(loadedAddRedaction2.isAddToDossierDictionary()).isEqualTo(false);
|
||||||
assertThat(loadedAddRedaction2.isAddToDictionary()).isEqualTo(true);
|
assertThat(loadedAddRedaction2.isAddToDictionary()).isEqualTo(true);
|
||||||
|
assertThat(loadedAddRedaction2.getSection()).contains("section2");
|
||||||
|
|
||||||
var removeRedaction = manualRedactionClient.addRemoveRedaction(dossier.getId(), file.getId(), RemoveRedactionRequest.builder()
|
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));
|
manualRedactionClient.updateRemoveRedactionStatus(dossier.getId(), file.getId(), removeRedaction.getAnnotationId(), JSONPrimitive.of(AnnotationStatus.REQUESTED));
|
||||||
var loadedRemoveRedaction = manualRedactionClient.getRemoveRedaction(file.getId(), removeRedaction.getAnnotationId());
|
var loadedRemoveRedaction = manualRedactionClient.getRemoveRedaction(file.getId(), removeRedaction.getAnnotationId());
|
||||||
assertThat(loadedRemoveRedaction.isRemoveFromDictionary()).isEqualTo(false);
|
assertThat(loadedRemoveRedaction.isRemoveFromDictionary()).isEqualTo(false);
|
||||||
@ -98,7 +131,12 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|||||||
assertThat(loadedRemoveRedaction.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
assertThat(loadedRemoveRedaction.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
||||||
|
|
||||||
var removeRedaction2 = manualRedactionClient.addRemoveRedaction(dossier.getId(), file.getId(), RemoveRedactionRequest.builder()
|
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));
|
manualRedactionClient.updateRemoveRedactionStatus(dossier.getId(), file.getId(), removeRedaction2.getAnnotationId(), JSONPrimitive.of(AnnotationStatus.REQUESTED));
|
||||||
var loadedRemoveRedaction2 = manualRedactionClient.getRemoveRedaction(file.getId(), removeRedaction2.getAnnotationId());
|
var loadedRemoveRedaction2 = manualRedactionClient.getRemoveRedaction(file.getId(), removeRedaction2.getAnnotationId());
|
||||||
assertThat(loadedRemoveRedaction2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
assertThat(loadedRemoveRedaction2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
||||||
@ -113,9 +151,13 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|||||||
loadedRemoveRedaction2 = manualRedactionClient.getRemoveRedaction(file.getId(), removeRedaction2.getAnnotationId());
|
loadedRemoveRedaction2 = manualRedactionClient.getRemoveRedaction(file.getId(), removeRedaction2.getAnnotationId());
|
||||||
assertThat(loadedRemoveRedaction2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
assertThat(loadedRemoveRedaction2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
||||||
|
|
||||||
|
|
||||||
var forceRedaction = manualRedactionClient.addForceRedaction(dossier.getId(), file.getId(), ForceRedactionRequest.builder()
|
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());
|
var loadedForceRedaction = manualRedactionClient.getForceRedaction(file.getId(), forceRedaction.getAnnotationId());
|
||||||
assertThat(loadedForceRedaction.getLegalBasis()).isEqualTo("1");
|
assertThat(loadedForceRedaction.getLegalBasis()).isEqualTo("1");
|
||||||
assertThat(loadedForceRedaction.getUser()).isEqualTo("test");
|
assertThat(loadedForceRedaction.getUser()).isEqualTo("test");
|
||||||
@ -130,9 +172,13 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|||||||
loadedForceRedaction = manualRedactionClient.getForceRedaction(file.getId(), addRedaction.getAnnotationId());
|
loadedForceRedaction = manualRedactionClient.getForceRedaction(file.getId(), addRedaction.getAnnotationId());
|
||||||
assertThat(loadedForceRedaction.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
assertThat(loadedForceRedaction.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
||||||
|
|
||||||
|
|
||||||
var legalBasisChange = manualRedactionClient.addLegalBasisChange(dossier.getId(), file.getId(), LegalBasisChangeRequest.builder()
|
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());
|
var loadedLegalBasisChange = manualRedactionClient.getLegalBasisChange(file.getId(), addRedaction.getAnnotationId());
|
||||||
assertThat(loadedLegalBasisChange.getAnnotationId()).isEqualTo(legalBasisChange.getAnnotationId());
|
assertThat(loadedLegalBasisChange.getAnnotationId()).isEqualTo(legalBasisChange.getAnnotationId());
|
||||||
assertThat(loadedLegalBasisChange.getUser()).isEqualTo("test");
|
assertThat(loadedLegalBasisChange.getUser()).isEqualTo("test");
|
||||||
@ -146,9 +192,13 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|||||||
loadedLegalBasisChange = manualRedactionClient.getLegalBasisChange(file.getId(), addRedaction.getAnnotationId());
|
loadedLegalBasisChange = manualRedactionClient.getLegalBasisChange(file.getId(), addRedaction.getAnnotationId());
|
||||||
assertThat(loadedLegalBasisChange.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
assertThat(loadedLegalBasisChange.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
||||||
|
|
||||||
|
|
||||||
var imageRecategorization = manualRedactionClient.addImageRecategorization(dossier.getId(), file.getId(), ImageRecategorizationRequest.builder()
|
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());
|
var loadedImageRecategorization = manualRedactionClient.getImageRecategorization(file.getId(), addRedaction.getAnnotationId());
|
||||||
assertThat(loadedImageRecategorization.getAnnotationId()).isEqualTo(imageRecategorization.getAnnotationId());
|
assertThat(loadedImageRecategorization.getAnnotationId()).isEqualTo(imageRecategorization.getAnnotationId());
|
||||||
|
|
||||||
@ -161,7 +211,12 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|||||||
assertThat(loadedImageRecategorization.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
assertThat(loadedImageRecategorization.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
||||||
|
|
||||||
var imageRecategorization2 = manualRedactionClient.addImageRecategorization(dossier.getId(), file.getId(), ImageRecategorizationRequest.builder()
|
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());
|
var loadedImageRecategorization2 = manualRedactionClient.getImageRecategorization(file.getId(), imageRecategorization2.getAnnotationId());
|
||||||
assertThat(loadedImageRecategorization2.getStatus()).isEqualTo(AnnotationStatus.APPROVED);
|
assertThat(loadedImageRecategorization2.getStatus()).isEqualTo(AnnotationStatus.APPROVED);
|
||||||
|
|
||||||
@ -170,7 +225,14 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|||||||
assertThat(loadedImageRecategorization2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
assertThat(loadedImageRecategorization2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
||||||
|
|
||||||
var resizeRedaction = manualRedactionClient.addResizeRedaction(dossier.getId(), file.getId(), ResizeRedactionRequest.builder()
|
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());
|
var loadedResizeRedaction = manualRedactionClient.getResizeRedaction(file.getId(), resizeRedaction.getAnnotationId());
|
||||||
assertThat(loadedResizeRedaction.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
assertThat(loadedResizeRedaction.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
||||||
assertThat(loadedResizeRedaction.getUser()).isEqualTo("test");
|
assertThat(loadedResizeRedaction.getUser()).isEqualTo("test");
|
||||||
@ -185,7 +247,6 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|||||||
loadedResizeRedaction = manualRedactionClient.getResizeRedaction(file.getId(), resizeRedaction.getAnnotationId());
|
loadedResizeRedaction = manualRedactionClient.getResizeRedaction(file.getId(), resizeRedaction.getAnnotationId());
|
||||||
assertThat(loadedResizeRedaction.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
assertThat(loadedResizeRedaction.getStatus()).isEqualTo(AnnotationStatus.DECLINED);
|
||||||
|
|
||||||
|
|
||||||
ManualRedactions manualRedactions = manualRedactionClient.getManualRedactions(dossier.getId(), file.getId());
|
ManualRedactions manualRedactions = manualRedactionClient.getManualRedactions(dossier.getId(), file.getId());
|
||||||
assertThat(manualRedactions.getForceRedactions()).isNotEmpty();
|
assertThat(manualRedactions.getForceRedactions()).isNotEmpty();
|
||||||
assertThat(manualRedactions.getLegalBasisChanges()).isNotEmpty();
|
assertThat(manualRedactions.getLegalBasisChanges()).isNotEmpty();
|
||||||
@ -195,33 +256,47 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|||||||
assertThat(manualRedactions.getComments()).isNotEmpty();
|
assertThat(manualRedactions.getComments()).isNotEmpty();
|
||||||
assertThat(manualRedactions.getResizeRedactions()).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.getComments()
|
||||||
manualRedactions.getLegalBasisChanges().forEach(e -> manualRedactionClient.deleteLegalBasisChange(dossier.getId(), file.getId(), e.getAnnotationId()));
|
.forEach((key, value) -> value.forEach(c -> manualRedactionClient.deleteComment(file.getId(), c.getId())));
|
||||||
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())));
|
|
||||||
|
|
||||||
|
|
||||||
var forceRedaction2 = manualRedactionClient.addForceRedaction(dossier.getId(), file.getId(), ForceRedactionRequest.builder()
|
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());
|
var loadedForceRedaction2 = manualRedactionClient.getForceRedaction(file.getId(), forceRedaction2.getAnnotationId());
|
||||||
assertThat(loadedForceRedaction2.getStatus()).isEqualTo(AnnotationStatus.APPROVED);
|
assertThat(loadedForceRedaction2.getStatus()).isEqualTo(AnnotationStatus.APPROVED);
|
||||||
|
|
||||||
|
|
||||||
manualRedactionClient.updateForceRedactionStatus(dossier.getId(), file.getId(), forceRedaction2.getAnnotationId(), JSONPrimitive.of(AnnotationStatus.REQUESTED));
|
manualRedactionClient.updateForceRedactionStatus(dossier.getId(), file.getId(), forceRedaction2.getAnnotationId(), JSONPrimitive.of(AnnotationStatus.REQUESTED));
|
||||||
loadedForceRedaction2 = manualRedactionClient.getForceRedaction(file.getId(), forceRedaction2.getAnnotationId());
|
loadedForceRedaction2 = manualRedactionClient.getForceRedaction(file.getId(), forceRedaction2.getAnnotationId());
|
||||||
assertThat(loadedForceRedaction2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
assertThat(loadedForceRedaction2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
||||||
|
|
||||||
manualRedactions = manualRedactionClient.getManualRedactions(dossier.getId(), file.getId());
|
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()
|
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());
|
var loadedLegalBasisChange2 = manualRedactionClient.getLegalBasisChange(file.getId(), legalBasisChange2.getAnnotationId());
|
||||||
assertThat(loadedLegalBasisChange2.getStatus()).isEqualTo(AnnotationStatus.APPROVED);
|
assertThat(loadedLegalBasisChange2.getStatus()).isEqualTo(AnnotationStatus.APPROVED);
|
||||||
|
|
||||||
@ -230,10 +305,18 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|||||||
assertThat(loadedLegalBasisChange2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
assertThat(loadedLegalBasisChange2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
||||||
|
|
||||||
manualRedactions = manualRedactionClient.getManualRedactions(dossier.getId(), file.getId());
|
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()
|
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());
|
var loadedResizeRedaction2 = manualRedactionClient.getResizeRedaction(file.getId(), resizeRedaction2.getAnnotationId());
|
||||||
assertThat(loadedResizeRedaction2.getStatus()).isEqualTo(AnnotationStatus.APPROVED);
|
assertThat(loadedResizeRedaction2.getStatus()).isEqualTo(AnnotationStatus.APPROVED);
|
||||||
assertThat(loadedResizeRedaction2.getUser()).isEqualTo("test");
|
assertThat(loadedResizeRedaction2.getUser()).isEqualTo("test");
|
||||||
@ -245,4 +328,5 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
|||||||
assertThat(loadedResizeRedaction2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
assertThat(loadedResizeRedaction2.getStatus()).isEqualTo(AnnotationStatus.REQUESTED);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user