From 926e8b6b6be8172f9352e9bc3d5d4304b245a1c9 Mon Sep 17 00:00:00 2001 From: Andrei Isvoran Date: Mon, 13 May 2024 12:42:42 +0300 Subject: [PATCH] RED-9146 - Change response for manual redaction endpoints to an object wrapping the list --- .../controller/ManualRedactionController.java | 25 ++++----- .../resource/ManualRedactionResource.java | 13 ++--- .../v1/server/integration/tests/FileTest.java | 5 +- .../tests/ManualRedactionTest.java | 52 +++++++++---------- .../annotations/ManualRedactionResponse.java | 17 ++++++ 5 files changed, 65 insertions(+), 47 deletions(-) create mode 100644 persistence-service-v1/persistence-service-shared-api-v1/src/main/java/com/iqser/red/service/persistence/service/v1/api/shared/model/annotations/ManualRedactionResponse.java diff --git a/persistence-service-v1/persistence-service-external-api-impl-v1/src/main/java/com/iqser/red/persistence/service/v1/external/api/impl/controller/ManualRedactionController.java b/persistence-service-v1/persistence-service-external-api-impl-v1/src/main/java/com/iqser/red/persistence/service/v1/external/api/impl/controller/ManualRedactionController.java index 090a02e20..0cca9a680 100644 --- a/persistence-service-v1/persistence-service-external-api-impl-v1/src/main/java/com/iqser/red/persistence/service/v1/external/api/impl/controller/ManualRedactionController.java +++ b/persistence-service-v1/persistence-service-external-api-impl-v1/src/main/java/com/iqser/red/persistence/service/v1/external/api/impl/controller/ManualRedactionController.java @@ -31,6 +31,7 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.Comment; import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.CommentRequest; import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.ManualAddResponse; +import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.ManualRedactionResponse; import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.ManualRedactions; import com.iqser.red.service.persistence.service.v1.api.shared.model.audit.AuditRequest; import com.iqser.red.service.persistence.service.v1.api.shared.model.manual.AddCommentRequestModel; @@ -157,7 +158,7 @@ public class ManualRedactionController implements ManualRedactionResource { @Override @PreAuthorize("hasAuthority('" + DO_MANUAL_REDACTION + "')") - public List addRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId, + public ManualRedactionResponse addRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody Set addRedactionRequests) { @@ -180,12 +181,12 @@ public class ManualRedactionController implements ManualRedactionResource { .details(Map.of(DOSSIER_ID, dossierId, FILE_ID, fileId, ANNOTATION_ID, response.getAnnotationId())) .build())); - return responseList; + return ManualRedactionResponse.builder().manualAddResponses(responseList).build(); } @PreAuthorize("hasAuthority('" + DO_MANUAL_REDACTION + "')") - public List removeRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId, + public ManualRedactionResponse removeRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody Set removeRedactionRequests, @RequestParam(value = "includeUnprocessed", required = false, defaultValue = FALSE) boolean includeUnprocessed) { @@ -214,12 +215,12 @@ public class ManualRedactionController implements ManualRedactionResource { .details(Map.of(DOSSIER_ID, dossierId, FILE_ID, fileId, ANNOTATION_ID, response.getAnnotationId())) .build())); - return responseList; + return ManualRedactionResponse.builder().manualAddResponses(responseList).build(); } @PreAuthorize("hasAuthority('" + DO_MANUAL_REDACTION + "')") - public List forceRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId, + public ManualRedactionResponse forceRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody Set forceRedactionRequests) { @@ -237,13 +238,13 @@ public class ManualRedactionController implements ManualRedactionResource { .details(Map.of(DOSSIER_ID, dossierId, FILE_ID, fileId, ANNOTATION_ID, response.getAnnotationId())) .build())); - return responseList; + return ManualRedactionResponse.builder().manualAddResponses(responseList).build(); } @Deprecated(forRemoval = true) @PreAuthorize("hasAuthority('" + DO_MANUAL_REDACTION + "')") - public List legalBasisChangeBulk(@PathVariable(DOSSIER_ID) String dossierId, + public ManualRedactionResponse legalBasisChangeBulk(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody Set legalBasisChangeRequests) { @@ -261,12 +262,12 @@ public class ManualRedactionController implements ManualRedactionResource { .details(Map.of(DOSSIER_ID, dossierId, FILE_ID, fileId, ANNOTATION_ID, response.getAnnotationId())) .build())); - return responseList; + return ManualRedactionResponse.builder().manualAddResponses(responseList).build(); } @PreAuthorize("hasAuthority('" + DO_MANUAL_REDACTION + "')") - public List recategorizeBulk(@PathVariable(DOSSIER_ID) String dossierId, + public ManualRedactionResponse recategorizeBulk(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody Set recategorizationRequests, @RequestParam(value = "includeUnprocessed", required = false, defaultValue = FALSE) boolean includeUnprocessed) { @@ -290,12 +291,12 @@ public class ManualRedactionController implements ManualRedactionResource { .details(Map.of(DOSSIER_ID, dossierId, FILE_ID, fileId, ANNOTATION_ID, response.getAnnotationId())) .build())); - return responseList; + return ManualRedactionResponse.builder().manualAddResponses(responseList).build(); } @PreAuthorize("hasAuthority('" + DO_MANUAL_REDACTION + "')") - public List resizeRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId, + public ManualRedactionResponse resizeRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody Set resizeRedactionRequests, @RequestParam(value = "includeUnprocessed", required = false, defaultValue = FALSE) boolean includeUnprocessed) { @@ -314,7 +315,7 @@ public class ManualRedactionController implements ManualRedactionResource { .details(Map.of(DOSSIER_ID, dossierId, FILE_ID, fileId, ANNOTATION_ID, response.getAnnotationId())) .build())); - return responseList; + return ManualRedactionResponse.builder().manualAddResponses(responseList).build(); } } diff --git a/persistence-service-v1/persistence-service-external-api-v1/src/main/java/com/iqser/red/service/persistence/service/v1/api/external/resource/ManualRedactionResource.java b/persistence-service-v1/persistence-service-external-api-v1/src/main/java/com/iqser/red/service/persistence/service/v1/api/external/resource/ManualRedactionResource.java index d251f3ced..a6163254c 100644 --- a/persistence-service-v1/persistence-service-external-api-v1/src/main/java/com/iqser/red/service/persistence/service/v1/api/external/resource/ManualRedactionResource.java +++ b/persistence-service-v1/persistence-service-external-api-v1/src/main/java/com/iqser/red/service/persistence/service/v1/api/external/resource/ManualRedactionResource.java @@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.ResponseStatus; import com.iqser.red.service.persistence.service.v1.api.shared.model.CommentResponse; import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationComments; import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.ManualAddResponse; +import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.ManualRedactionResponse; import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.ManualRedactions; 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; @@ -90,7 +91,7 @@ public interface ManualRedactionResource { + FILE_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @Operation(summary = "Adds a manual redaction", description = "None") @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "404", description = "Dossier or file not found"), @ApiResponse(responseCode = "403", description = "Forbidden")}) - List addRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId, + ManualRedactionResponse addRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody Set addRedactionRequest); @@ -102,7 +103,7 @@ public interface ManualRedactionResource { + FILE_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @Operation(summary = "Removes the redactions list", description = "None") @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "404", description = "Dossier or file not found"), @ApiResponse(responseCode = "403", description = "Forbidden")}) - List removeRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId, + ManualRedactionResponse removeRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody Set removeRedactionRequests, @RequestParam(value = "includeUnprocessed", required = false, defaultValue = FALSE) boolean includeUnprocessed); @@ -115,7 +116,7 @@ public interface ManualRedactionResource { + FILE_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @Operation(summary = "Forces the redactions list", description = "None") @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "404", description = "Dossier or file not found"), @ApiResponse(responseCode = "403", description = "Forbidden")}) - List forceRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId, + ManualRedactionResponse forceRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody Set forceRedactionRequests); @@ -128,7 +129,7 @@ public interface ManualRedactionResource { + FILE_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @Operation(summary = "Changes the legal basis reasons list", description = "None") @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "404", description = "Dossier or file not found"), @ApiResponse(responseCode = "403", description = "Forbidden")}) - List legalBasisChangeBulk(@PathVariable(DOSSIER_ID) String dossierId, + ManualRedactionResponse legalBasisChangeBulk(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody Set legalBasisChangeRequests); @@ -140,7 +141,7 @@ public interface ManualRedactionResource { + FILE_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @Operation(summary = "Recategorizes the list of redaction log entries", description = "None") @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "404", description = "Dossier or file not found"), @ApiResponse(responseCode = "403", description = "Forbidden")}) - List recategorizeBulk(@PathVariable(DOSSIER_ID) String dossierId, + ManualRedactionResponse recategorizeBulk(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody Set recategorizationRequests, @RequestParam(value = "includeUnprocessed", required = false, defaultValue = FALSE) boolean includeUnprocessed); @@ -153,7 +154,7 @@ public interface ManualRedactionResource { + FILE_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @Operation(summary = "Resizes the redactions list", description = "None") @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "404", description = "Dossier or file not found"), @ApiResponse(responseCode = "403", description = "Forbidden")}) - List resizeRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId, + ManualRedactionResponse resizeRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody Set resizeRedactionRequests, @RequestParam(value = "includeUnprocessed", required = false, defaultValue = FALSE) boolean includeUnprocessed); diff --git a/persistence-service-v1/persistence-service-server-v1/src/test/java/com/iqser/red/service/peristence/v1/server/integration/tests/FileTest.java b/persistence-service-v1/persistence-service-server-v1/src/test/java/com/iqser/red/service/peristence/v1/server/integration/tests/FileTest.java index e6ea51de8..053ee759c 100644 --- a/persistence-service-v1/persistence-service-server-v1/src/test/java/com/iqser/red/service/peristence/v1/server/integration/tests/FileTest.java +++ b/persistence-service-v1/persistence-service-server-v1/src/test/java/com/iqser/red/service/peristence/v1/server/integration/tests/FileTest.java @@ -476,7 +476,7 @@ public class FileTest extends AbstractPersistenceServerServiceTest { fileClient.setStatusUnderReview(dossier.getId(), file.getId(), userId); - var addRedaction = manualRedactionClient.addRedactionBulk(dossierId, + manualRedactionClient.addRedactionBulk(dossierId, fileId, Set.of(AddRedactionRequestModel.builder() .addToDictionary(true) @@ -487,8 +487,7 @@ public class FileTest extends AbstractPersistenceServerServiceTest { .value("test") .legalBasis("1") .dictionaryEntryType(DictionaryEntryType.ENTRY) - .build())) - .iterator().next(); + .build())); var loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId()); diff --git a/persistence-service-v1/persistence-service-server-v1/src/test/java/com/iqser/red/service/peristence/v1/server/integration/tests/ManualRedactionTest.java b/persistence-service-v1/persistence-service-server-v1/src/test/java/com/iqser/red/service/peristence/v1/server/integration/tests/ManualRedactionTest.java index a1ff3d00a..3de46caef 100644 --- a/persistence-service-v1/persistence-service-server-v1/src/test/java/com/iqser/red/service/peristence/v1/server/integration/tests/ManualRedactionTest.java +++ b/persistence-service-v1/persistence-service-server-v1/src/test/java/com/iqser/red/service/peristence/v1/server/integration/tests/ManualRedactionTest.java @@ -412,7 +412,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { file.getId(), Set.of(RemoveRedactionRequestModel.builder().annotationId("AnnotationId").removeFromDictionary(true).build()), false) - .get(0); + .getManualAddResponses().get(0); var dossierDictionary = internalDictionaryClient.getDictionaryForType(toTypeId(type.getType(), dossierTemplate.getId(), dossier.getId()), null); @@ -471,7 +471,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { .removeFromAllDossiers(true) .build()), false) - .get(0); + .getManualAddResponses().get(0); var dossierDictionary = internalDictionaryClient.getDictionaryForType(toTypeId(type.getType(), dossierTemplate.getId(), dossier.getId()), null); assertThat(dossierDictionary.getEntries().size()).isEqualTo(1); @@ -534,7 +534,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { var entityLog1 = new EntityLog(1, 1, List.of(EntityLogEntry.builder() - .id(addRedactions.get(0).getAnnotationId()) + .id(addRedactions.getManualAddResponses().get(0).getAnnotationId()) .type(typeDosDict.getType()) .value("test redaction in dossier") .dossierDictionaryEntry(true) @@ -542,7 +542,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { .state(EntryState.APPLIED) .build(), EntityLogEntry.builder() - .id(addRedactions.get(1).getAnnotationId()) + .id(addRedactions.getManualAddResponses().get(1).getAnnotationId()) .type(typeDosTempDict.getType()) .value("test redaction in dossier template") .dictionaryEntry(true) @@ -561,7 +561,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { var entityLog2 = new EntityLog(1, 1, List.of(EntityLogEntry.builder() - .id(addRedactions.get(1).getAnnotationId()) + .id(addRedactions.getManualAddResponses().get(1).getAnnotationId()) .type(typeDosTempDict.getType()) .value("test redaction in dossier template") .dictionaryEntry(true) @@ -579,7 +579,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { // resize redaction in dossier 1 var resizeRedactionDosAndAddToAllDos = ResizeRedactionRequestModel.builder() - .annotationId(addRedactions.get(0).getAnnotationId()) + .annotationId(addRedactions.getManualAddResponses().get(0).getAnnotationId()) .comment("resized dossier redaction") .value("test redaction in dossier dictionary") .updateDictionary(true) @@ -699,7 +699,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { var entityLog1 = new EntityLog(1, 1, List.of(EntityLogEntry.builder() - .id(addRedactions.get(0).getAnnotationId()) + .id(addRedactions.getManualAddResponses().get(0).getAnnotationId()) .type(typeDosDict.getType()) .value("test redaction in dossier yayy") .dossierDictionaryEntry(true) @@ -707,7 +707,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { .state(EntryState.APPLIED) .build(), EntityLogEntry.builder() - .id(addRedactions.get(1).getAnnotationId()) + .id(addRedactions.getManualAddResponses().get(1).getAnnotationId()) .type(typeDosTempDict.getType()) .value("test redaction in dossier template yayy") .dictionaryEntry(true) @@ -726,7 +726,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { var entityLog2 = new EntityLog(1, 1, List.of(EntityLogEntry.builder() - .id(addRedactions.get(1).getAnnotationId()) + .id(addRedactions.getManualAddResponses().get(1).getAnnotationId()) .type(typeDosTempDict.getType()) .value("test redaction in dossier template yayy") .dictionaryEntry(true) @@ -744,7 +744,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { // resize redaction in dossier 1 var resizeRedactionDosAndAddToAllDos = ResizeRedactionRequestModel.builder() - .annotationId(addRedactions.get(0).getAnnotationId()) + .annotationId(addRedactions.getManualAddResponses().get(0).getAnnotationId()) .comment("resized dossier redaction") .value("test redaction in dossier") .updateDictionary(true) @@ -868,7 +868,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { var entityLog1 = new EntityLog(1, 1, List.of(EntityLogEntry.builder() - .id(addRedactions.get(0).getAnnotationId()) + .id(addRedactions.getManualAddResponses().get(0).getAnnotationId()) .type(typeDosDict.getType()) .value("test redaction in dossier") .dossierDictionaryEntry(true) @@ -876,7 +876,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { .state(EntryState.APPLIED) .build(), EntityLogEntry.builder() - .id(addRedactions.get(1).getAnnotationId()) + .id(addRedactions.getManualAddResponses().get(1).getAnnotationId()) .type(typeDosTempDict.getType()) .value("test redaction in dossier template") .dictionaryEntry(true) @@ -895,7 +895,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { var entityLog2 = new EntityLog(1, 1, List.of(EntityLogEntry.builder() - .id(addRedactions.get(1).getAnnotationId()) + .id(addRedactions.getManualAddResponses().get(1).getAnnotationId()) .type(typeDosTempDict.getType()) .value("test redaction in dossier template") .dictionaryEntry(true) @@ -913,7 +913,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { // resize redaction in dossier dict var resizeRedactionDosTemp = ResizeRedactionRequestModel.builder() - .annotationId(addRedactions.get(1).getAnnotationId()) + .annotationId(addRedactions.getManualAddResponses().get(1).getAnnotationId()) .comment("resized dossier template redaction") .value("test redaction in dossier template dictionary") .updateDictionary(true) @@ -1034,7 +1034,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { var entityLog1 = new EntityLog(1, 1, List.of(EntityLogEntry.builder() - .id(addRedactions.get(0).getAnnotationId()) + .id(addRedactions.getManualAddResponses().get(0).getAnnotationId()) .type(typeDosDict.getType()) .value("test redaction in dossier yayy") .dossierDictionaryEntry(true) @@ -1042,7 +1042,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { .state(EntryState.APPLIED) .build(), EntityLogEntry.builder() - .id(addRedactions.get(1).getAnnotationId()) + .id(addRedactions.getManualAddResponses().get(1).getAnnotationId()) .type(typeDosTempDict.getType()) .value("test redaction in dossier template yayy") .dictionaryEntry(true) @@ -1061,7 +1061,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { var entityLog2 = new EntityLog(1, 1, List.of(EntityLogEntry.builder() - .id(addRedactions.get(1).getAnnotationId()) + .id(addRedactions.getManualAddResponses().get(1).getAnnotationId()) .type(typeDosTempDict.getType()) .value("test redaction in dossier template yayy") .dictionaryEntry(true) @@ -1079,7 +1079,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { // resize redaction in dossier dict var resizeRedactionDosTemp = ResizeRedactionRequestModel.builder() - .annotationId(addRedactions.get(1).getAnnotationId()) + .annotationId(addRedactions.getManualAddResponses().get(1).getAnnotationId()) .comment("resized dossier template redaction") .value("test redaction in dossier template") .updateDictionary(true) @@ -2039,7 +2039,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { .anyMatch(entry -> entry.getAnnotationId().equals("annotationId"))); assertThatThrownBy(() -> manualRedactionClient.recategorizeBulk(dossier.getId(), file.getId(), Set.of(recatModelLongLegalBasis), false) - .get(0)).isInstanceOf(FeignException.class).hasMessageContaining("The legal basis is too long"); + .getManualAddResponses().get(0)).isInstanceOf(FeignException.class).hasMessageContaining("The legal basis is too long"); assertNull(allManualRedactions.getRecategorizations() .stream() @@ -2527,7 +2527,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { .positions(List.of(new Rectangle(10f, 10f ,10f, 10f, 1))) .value("MyValue") .build())) - .get(0); + .getManualAddResponses().get(0); assertEquals(response.getEntityLogEntry().getId(), response.getAnnotationId()); assertEquals(response.getEntityLogEntry().getValue(), "MyValue"); @@ -2576,7 +2576,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { .annotationId("AnnotationId") .legalBasis("legalBasis") .build())) - .get(0); + .getManualAddResponses().get(0); assertEquals(response.getEntityLogEntry().getId(), "AnnotationId"); assertEquals(response.getEntityLogEntry().getLegalBasis(), "legalBasis"); @@ -2623,7 +2623,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { .value("Luke Skywalker") .section("") .build())) - .get(0); + .getManualAddResponses().get(0); assertEquals(response.getEntityLogEntry().getId(), "AnnotationId"); assertEquals(response.getEntityLogEntry().getLegalBasis(), "new legal basis"); @@ -2671,7 +2671,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { .positions(List.of(new Rectangle(5f, 5f, 5f ,5f ,1))) .build()), false) - .get(0); + .getManualAddResponses().get(0); assertEquals(response.getEntityLogEntry().getId(), "AnnotationId"); assertEquals(response.getEntityLogEntry().getValue(), "Luke"); @@ -2726,7 +2726,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { .value("Luke Skywalker") .build()), false) - .get(0); + .getManualAddResponses().get(0); assertEquals(response.getEntityLogEntry().getId(), "AnnotationId"); assertEquals(response.getEntityLogEntry().getType(), type2.getType()); @@ -2772,7 +2772,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { .removeFromAllDossiers(false) .build()), false) - .get(0); + .getManualAddResponses().get(0); assertEquals(response.getEntityLogEntry().getId(), "AnnotationId"); assertEquals(response.getEntityLogEntry().getState(), EntryState.IGNORED); @@ -2829,7 +2829,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest { .value("Luke Skywalker") .build()), false) - .get(0); + .getManualAddResponses().get(0); assertEquals(response.getEntityLogEntry().getId(), "AnnotationId"); assertEquals(response.getEntityLogEntry().getType(), type2.getType()); diff --git a/persistence-service-v1/persistence-service-shared-api-v1/src/main/java/com/iqser/red/service/persistence/service/v1/api/shared/model/annotations/ManualRedactionResponse.java b/persistence-service-v1/persistence-service-shared-api-v1/src/main/java/com/iqser/red/service/persistence/service/v1/api/shared/model/annotations/ManualRedactionResponse.java new file mode 100644 index 000000000..9f56198db --- /dev/null +++ b/persistence-service-v1/persistence-service-shared-api-v1/src/main/java/com/iqser/red/service/persistence/service/v1/api/shared/model/annotations/ManualRedactionResponse.java @@ -0,0 +1,17 @@ +package com.iqser.red.service.persistence.service.v1.api.shared.model.annotations; + +import java.util.List; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ManualRedactionResponse { + + private List manualAddResponses; +} -- 2.47.2