diff --git a/mod-audit-server/pom.xml b/mod-audit-server/pom.xml index 9e13cbf0..a73fdcb1 100644 --- a/mod-audit-server/pom.xml +++ b/mod-audit-server/pom.xml @@ -46,7 +46,7 @@ org.apache.kafka kafka-clients - 3.1.0 + 3.6.1 io.vertx @@ -55,7 +55,7 @@ net.mguenther.kafka kafka-junit - 3.1.0 + 3.6.0 test @@ -153,7 +153,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.12.1 17 UTF-8 @@ -163,7 +163,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.5.0 add_generated_sources_folder @@ -221,7 +221,7 @@ dev.aspectj aspectj-maven-plugin - 1.13.1 + 1.14 true false @@ -266,7 +266,7 @@ org.apache.maven.plugins maven-resources-plugin - 3.1.0 + 3.3.1 copy-resources @@ -310,7 +310,7 @@ org.apache.maven.plugins maven-antrun-plugin - 3.0.0 + 3.1.0 prepare-package @@ -334,7 +334,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.2.2 + 3.5.2 package @@ -377,7 +377,7 @@ org.apache.maven.plugins maven-release-plugin - 2.5.3 + 3.0.1 clean verify v@{project.version} diff --git a/mod-audit-server/src/main/java/org/folio/rest/impl/AuditHandlersService.java b/mod-audit-server/src/main/java/org/folio/rest/impl/AuditHandlersService.java index afd97d7a..87d66e7b 100644 --- a/mod-audit-server/src/main/java/org/folio/rest/impl/AuditHandlersService.java +++ b/mod-audit-server/src/main/java/org/folio/rest/impl/AuditHandlersService.java @@ -32,7 +32,7 @@ public class AuditHandlersService extends BaseService implements AuditHandlers { @Override @Validate public void postAuditHandlersLogRecord(String entity, Map okapiHeaders, - Handler> asyncResultHandler, Context vertxContext) { + Handler> asyncResultHandler, Context vertxContext) { LOGGER.debug("postAuditHandlersLogRecord:: Trying to Save AuditHandlersLogRecord request with entity: {}", entity); try { LOGGER.info("postAuditHandlersLogRecord:: Saving AuditHandlersLogRecord request with entity: {}", entity); @@ -52,6 +52,7 @@ public void postAuditHandlersLogRecord(String entity, Map okapiH } } + private CompletableFuture> processAnonymize(List records, Map okapiHeaders, Context vertxContext) { LOGGER.debug("processAnonymize:: Processing anonymize for records"); @@ -78,10 +79,10 @@ private CompletableFuture> anonymizeLoanRelatedRecords(List { if (reply.succeeded()) { LOGGER.info("anonymizeLoanRelatedRecords:: Anonymize loan-related records for log records Successfully"); - reply.result().getResults().forEach(record -> { - record.setUserBarcode(null); - record.setLinkToIds(record.getLinkToIds().withUserId(null)); - result.add(record); + reply.result().getResults().forEach(logRecord -> { + logRecord.setUserBarcode(null); + logRecord.setLinkToIds(logRecord.getLinkToIds().withUserId(null)); + result.add(logRecord); }); future.complete(result); } else { diff --git a/mod-audit-server/src/test/java/org/folio/rest/impl/AuditDataAcquisitionAPITest.java b/mod-audit-server/src/test/java/org/folio/rest/impl/AuditDataAcquisitionAPITest.java index 4234c741..08788e50 100644 --- a/mod-audit-server/src/test/java/org/folio/rest/impl/AuditDataAcquisitionAPITest.java +++ b/mod-audit-server/src/test/java/org/folio/rest/impl/AuditDataAcquisitionAPITest.java @@ -101,24 +101,24 @@ void shouldReturnOrderLineEventsOnGetByOrderLineId() { .withActionDate(new Date()) .withOrderLineSnapshot(jsonObject); - orderLineEventDao.save(orderLineAuditEvent, TENANT_ID); + orderLineEventDao.save(orderLineAuditEvent, TENANT_ID).onComplete(v -> { + given().header(CONTENT_TYPE).header(TENANT).header(PERMS).get(ACQ_AUDIT_ORDER_LINE_PATH + INVALID_ID) + .then().log().all().statusCode(200) + .body(containsString("orderLineAuditEvents")).body(containsString("totalItems")); - given().header(CONTENT_TYPE).header(TENANT).header(PERMS).get(ACQ_AUDIT_ORDER_LINE_PATH + INVALID_ID) - .then().log().all().statusCode(200) - .body(containsString("orderLineAuditEvents")).body(containsString("totalItems")); - - given().header(CONTENT_TYPE).header(TENANT).header(PERMS).get(ACQ_AUDIT_ORDER_LINE_PATH + ORDER_LINE_ID) - .then().log().all().statusCode(200) - .body(containsString(ORDER_LINE_ID)); + given().header(CONTENT_TYPE).header(TENANT).header(PERMS).get(ACQ_AUDIT_ORDER_LINE_PATH + ORDER_LINE_ID) + .then().log().all().statusCode(200) + .body(containsString(ORDER_LINE_ID)); - given().header(CONTENT_TYPE).header(TENANT).header(PERMS).get(ACQ_AUDIT_ORDER_LINE_PATH + ORDER_LINE_ID + "?limit=1").then().log().all().statusCode(200) - .body(containsString(ORDER_LINE_ID)); + given().header(CONTENT_TYPE).header(TENANT).header(PERMS).get(ACQ_AUDIT_ORDER_LINE_PATH + ORDER_LINE_ID + "?limit=1").then().log().all().statusCode(200) + .body(containsString(ORDER_LINE_ID)); - given().header(CONTENT_TYPE).header(TENANT).header(PERMS).get(ACQ_AUDIT_ORDER_LINE_PATH + ORDER_LINE_ID + "?sortBy=action_date").then().log().all().statusCode(200) - .body(containsString(ORDER_LINE_ID)); + given().header(CONTENT_TYPE).header(TENANT).header(PERMS).get(ACQ_AUDIT_ORDER_LINE_PATH + ORDER_LINE_ID + "?sortBy=action_date").then().log().all().statusCode(200) + .body(containsString(ORDER_LINE_ID)); - given().header(CONTENT_TYPE).header(TENANT).header(PERMS).get(ACQ_AUDIT_ORDER_PATH + ORDER_LINE_ID + 123).then().log().all().statusCode(500) - .body(containsString("UUID string too large")); + given().header(CONTENT_TYPE).header(TENANT).header(PERMS).get(ACQ_AUDIT_ORDER_PATH + ORDER_LINE_ID + 123).then().log().all().statusCode(500) + .body(containsString("UUID string too large")); + }); } @Test diff --git a/mod-audit-server/src/test/java/org/folio/rest/impl/CirculationLogsImplApiTest.java b/mod-audit-server/src/test/java/org/folio/rest/impl/CirculationLogsImplApiTest.java index ce39fe8a..70bc15d7 100644 --- a/mod-audit-server/src/test/java/org/folio/rest/impl/CirculationLogsImplApiTest.java +++ b/mod-audit-server/src/test/java/org/folio/rest/impl/CirculationLogsImplApiTest.java @@ -95,7 +95,7 @@ void anonymizeLoanShouldRemoveUserDataFromRelatedRecords() { .log().all() .statusCode(204); - await().atLeast(1, TimeUnit.SECONDS); + await().pollDelay(1, TimeUnit.SECONDS).until(() -> true); given().headers(HEADERS).get(CIRCULATION_LOGS_ENDPOINT + "?query=(items=845687423)") .then().log().all().statusCode(200) diff --git a/pom.xml b/pom.xml index a4fd0e44..41cec16f 100644 --- a/pom.xml +++ b/pom.xml @@ -18,12 +18,12 @@ - 1.9.19 - 35.0.4 - 4.3.5 + 1.9.21.1 + 35.2.0 + 4.5.4 2.25.1 5.6.2 - 4.3.0 + 5.4.0 2.14.1 2.7.0 0.7.3 @@ -65,7 +65,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.12.1 17 UTF-8 @@ -89,7 +89,7 @@ org.apache.maven.plugins maven-resources-plugin - 3.1.0 + 3.3.1 filter-descriptor-inputs @@ -141,7 +141,7 @@ org.apache.maven.plugins maven-release-plugin - 2.5.3 + 3.0.1 clean verify v@{project.version}