From 3881bdc5f1fcb27e4ee01f64b1ceb2b91e3f1f14 Mon Sep 17 00:00:00 2001 From: azizbekxm Date: Wed, 15 Nov 2023 19:13:20 +0500 Subject: [PATCH] [MODAUD-174] - Minor improvements --- .../org/folio/dao/acquisition/impl/OrderEventsDaoImpl.java | 2 +- .../folio/dao/acquisition/impl/OrderLineEventsDaoImpl.java | 2 +- .../org/folio/dao/acquisition/impl/PieceEventsDaoImpl.java | 2 +- .../java/org/folio/rest/impl/AuditDataAcquisitionImpl.java | 7 +------ .../org/folio/rest/impl/AuditDataAcquisitionAPITest.java | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderEventsDaoImpl.java b/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderEventsDaoImpl.java index b20d22a..d9ee92e 100644 --- a/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderEventsDaoImpl.java +++ b/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderEventsDaoImpl.java @@ -107,7 +107,7 @@ private OrderAuditEventCollection mapRowToListOfOrderEvent(RowSet rowSet) { orderAuditEventCollection.getOrderAuditEvents().add(mapRowToOrderEvent(row)); orderAuditEventCollection.setTotalItems(row.getInteger(TOTAL_RECORDS_FIELD)); }); - LOGGER.info("mapRowToListOfOrderEvent:: Mapped row to List of Order Events"); + LOGGER.debug("mapRowToListOfOrderEvent:: Mapped row to List of Order Events"); return orderAuditEventCollection; } diff --git a/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderLineEventsDaoImpl.java b/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderLineEventsDaoImpl.java index 78def8e..8909874 100644 --- a/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderLineEventsDaoImpl.java +++ b/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/OrderLineEventsDaoImpl.java @@ -110,7 +110,7 @@ private OrderLineAuditEventCollection mapRowToListOfOrderLineEvent(RowSet r orderLineAuditEventCollection.getOrderLineAuditEvents().add(mapRowToOrderLineEvent(row)); orderLineAuditEventCollection.setTotalItems(row.getInteger(TOTAL_RECORDS_FIELD)); }); - LOGGER.info("mapRowToListOfOrderLineEvent:: Mapped row to List of Order Line Events"); + LOGGER.debug("mapRowToListOfOrderLineEvent:: Mapped row to List of Order Line Events"); return orderLineAuditEventCollection; } diff --git a/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/PieceEventsDaoImpl.java b/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/PieceEventsDaoImpl.java index 5e69e1a..0920695 100644 --- a/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/PieceEventsDaoImpl.java +++ b/mod-audit-server/src/main/java/org/folio/dao/acquisition/impl/PieceEventsDaoImpl.java @@ -120,7 +120,7 @@ private PieceAuditEventCollection mapRowToListOfPieceEvent(RowSet rowSet) { pieceAuditEventCollection.getPieceAuditEvents().add(mapRowToPieceEvent(row)); pieceAuditEventCollection.setTotalItems(row.getInteger(TOTAL_RECORDS_FIELD)); }); - LOGGER.info("mapRowToListOfOrderEvent:: Mapped row to List of Piece Events"); + LOGGER.debug("mapRowToListOfOrderEvent:: Mapped row to List of Piece Events"); return pieceAuditEventCollection; } diff --git a/mod-audit-server/src/main/java/org/folio/rest/impl/AuditDataAcquisitionImpl.java b/mod-audit-server/src/main/java/org/folio/rest/impl/AuditDataAcquisitionImpl.java index b5236ae..f405be2 100644 --- a/mod-audit-server/src/main/java/org/folio/rest/impl/AuditDataAcquisitionImpl.java +++ b/mod-audit-server/src/main/java/org/folio/rest/impl/AuditDataAcquisitionImpl.java @@ -45,7 +45,6 @@ public void getAuditDataAcquisitionOrderById(String orderId, String sortBy, Audi int limit, int offset, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { LOGGER.debug("getAuditDataAcquisitionOrderById:: Retrieving Audit Data Acquisition Order By Id : {}", orderId); String tenantId = TenantTool.tenantId(okapiHeaders); - try { orderAuditEventsService.getAuditEventsByOrderId(orderId, sortBy, sortOrder.name(), limit, offset, tenantId) .map(GetAuditDataAcquisitionOrderByIdResponse::respond200WithApplicationJson) @@ -63,7 +62,6 @@ public void getAuditDataAcquisitionOrderLineById(String orderLineId, String sort int limit, int offset, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { LOGGER.debug("getAuditDataAcquisitionOrderLineById:: Retrieving Audit Data Acquisition Order Line By Id : {}", orderLineId); String tenantId = TenantTool.tenantId(okapiHeaders); - try { orderLineAuditEventsService.getAuditEventsByOrderLineId(orderLineId, sortBy, sortOrder.name(), limit, offset, tenantId) .map(GetAuditDataAcquisitionOrderLineByIdResponse::respond200WithApplicationJson) @@ -82,7 +80,6 @@ public void getAuditDataAcquisitionPieceById(String pieceId, String sortBy, Audi int limit, int offset, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { LOGGER.debug("getAuditDataAcquisitionOrderById:: Retrieving Audit Data Acquisition Piece By Id : {}", pieceId); String tenantId = TenantTool.tenantId(okapiHeaders); - try { pieceAuditEventsService.getAuditEventsByPieceId(pieceId, sortBy, sortOrder.name(), limit, offset, tenantId) .map(GetAuditDataAcquisitionPieceByIdResponse::respond200WithApplicationJson) @@ -99,11 +96,9 @@ public void getAuditDataAcquisitionPieceById(String pieceId, String sortBy, Audi public void getAuditDataAcquisitionPieceStatusChangeHistoryById(String pieceId, String sortBy, AuditDataAcquisitionPieceIdStatusChangeHistoryGetSortOrder sortOrder, int limit, int offset, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { - LOGGER.debug("getAuditDataAcquisitionOrderById:: Retrieving Audit Data Acquisition Piece with unique status By Id : {}", pieceId); + LOGGER.debug("getAuditDataAcquisitionOrderById:: Retrieving Audit Data Acquisition Piece with status changes By Id : {}", pieceId); String tenantId = TenantTool.tenantId(okapiHeaders); - try { - LOGGER.warn("Trying to get piece audit events with unique status by piece id: {}", pieceId); pieceAuditEventsService.getAuditEventsWithStatusChangesByPieceId(pieceId, sortBy, sortOrder.name(), limit, offset, tenantId) .map(GetAuditDataAcquisitionPieceByIdResponse::respond200WithApplicationJson) .map(Response.class::cast) 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 5f3162e..4d71eb0 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 @@ -163,7 +163,7 @@ void shouldReturnPieceEventsOnGetByPieceId() { } @Test - void shouldReturnPieceEventsStatusChangeHistoryGetByPieceId() { + void shouldReturnPieceEventsStatusChangesHistoryGetByPieceId() { String id1 = UUID.randomUUID().toString(); String id2 = UUID.randomUUID().toString(); String id3 = UUID.randomUUID().toString();