Skip to content

Commit

Permalink
MODAUD-168 (#153)
Browse files Browse the repository at this point in the history
* MODAUD-168 Added Loggers

* MODAUD-168 Removed action change due date

* MODAUD-168 Fixed test case

* MODAUD-168 Removed Loggers

* MODAUD-168 Fixed coed smells

* MODAUD-168 Corrected the Log statement

* MODAUD-168 Removed unused imports
  • Loading branch information
pavankumar181 authored Aug 8, 2023
1 parent 6d2f29d commit ce976be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static org.folio.rest.jaxrs.model.LogRecord.Action.AGE_TO_LOST;
import static org.folio.rest.jaxrs.model.LogRecord.Action.ANONYMIZE;
import static org.folio.rest.jaxrs.model.LogRecord.Action.CHANGED_DUE_DATE;
import static org.folio.rest.jaxrs.model.LogRecord.Object.LOAN;
import static org.folio.util.Constants.SYSTEM;
import static org.folio.util.JsonPropertyFetcher.getObjectProperty;
Expand Down Expand Up @@ -53,8 +52,8 @@ public CompletableFuture<List<LogRecord>> buildLogRecord(JsonObject fullPayload)
LOGGER.info("buildLogRecord:: Built Log Record for Anonymize Action");
return fetchItemDetails(payload)
.thenCompose(this::createResult);
} else if (isAction(payload, AGE_TO_LOST) || isAction(payload, CHANGED_DUE_DATE)) {
LOGGER.info("buildLogRecord:: Built Log Record for Age To Lost or Changed Due date Action");
} else if (isAction(payload, AGE_TO_LOST)) {
LOGGER.info("buildLogRecord:: Built Log Record for Age To Lost");
return fetchUserDetails(payload, getProperty(payload, USER_ID))
.thenCompose(this::createResult);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void testChangedDueDate() throws Exception {
assertThat(loanLogRecord.getAction(), equalTo(CHANGED_DUE_DATE));
assertThat(loanLogRecord.getDate(), is(not(nullValue())));
assertThat(loanLogRecord.getServicePointId(), equalTo("c4c90014-c8c9-4ade-8f24-b5e313319f4b"));
assertThat(loanLogRecord.getSource(), equalTo("Bernhard, Cordell"));
assertThat(loanLogRecord.getSource(), equalTo("ADMINISTRATOR, DIKU"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"logEventType" : "LOAN",
"payload": {
"userBarcode" : "631888472578232",
"itemBarcode" : "90000",
"itemId" : "100d10bf-2f06-4aa0-be15-0b95b2d9f9e3",
"instanceId" : "5bf370e0-8cca-4d9c-82e4-5170ab2a0a39",
Expand All @@ -9,6 +10,7 @@
"action" : "Changed due date",
"date" : "2020-10-14T10:10:41.610Z",
"servicePointId" : "c4c90014-c8c9-4ade-8f24-b5e313319f4b",
"updatedByUserId" : "fa96fec8-786f-505b-b55e-e0bb1150d548",
"loanId" : "336ec84c-27ed-483d-92e3-926fafa7ed1c"
}
}

0 comments on commit ce976be

Please sign in to comment.