Uploaded image for project: 'mod-circulation'
  1. mod-circulation
  2. CIRC-664

POST requests to /circulation/check-in-by-barcode fail with 500, NPE

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: P2
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 18.0.0
    • Labels:
      None
    • Template:
    • Sprint:
      EPAM-Veg Sprint 35
    • Story Points:
      0.5
    • Development Team:
      Vega

      Description

      It is possible to create an Overdue Fine Policy without overdueFine or overdueRecallFine values. Given such a policy applied to a loan, checkin fails catastrophically such that POST requests to /circulation/check-in-by-barcode with a body like

      {
        "servicePointId":"7c5abc9f-f3d7-4856-b8d7-6712462ca007",
        "checkInDate":"2020-02-24T20:54:47Z",
        "itemBarcode":"1582515806109957268",
        "id":"60a2c709-f612-4c90-b40f-7de8322c93a9"
      }
      

      fail with a 500 and the following response:

      java.lang.NullPointerException
      java.lang.NullPointerException
      	at org.folio.circulation.domain.policy.OverdueFinePolicy.getMaxOverdueFine(OverdueFinePolicy.java:52)
      	at org.folio.circulation.domain.OverdueFineCalculatorService.calculateOverdueFine(OverdueFineCalculatorService.java:101)
      	at org.folio.circulation.domain.OverdueFineCalculatorService.lambda$null$4(OverdueFineCalculatorService.java:85)
      	at org.folio.circulation.support.Result.after(Result.java:313)
      	at org.folio.circulation.domain.OverdueFineCalculatorService.lambda$null$5(OverdueFineCalculatorService.java:85)
      	at java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:981)
      	at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2124)
      	at org.folio.circulation.domain.OverdueFineCalculatorService.lambda$null$8(OverdueFineCalculatorService.java:85)
      	at org.folio.circulation.support.Result.after(Result.java:313)
      	at org.folio.circulation.domain.OverdueFineCalculatorService.lambda$calculateOverdueFine$9(OverdueFineCalculatorService.java:84)
      	at java.util.concurrent.CompletableFuture.uniCompose(CompletableFuture.java:952)
      	at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:926)
      	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
      	at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
      	at io.vertx.ext.web.client.impl.HttpContext.handleDispatchResponse(HttpContext.java:308)
      	at io.vertx.ext.web.client.impl.HttpContext.execute(HttpContext.java:295)
      	at io.vertx.ext.web.client.impl.HttpContext.next(HttpContext.java:270)
      	at io.vertx.ext.web.client.impl.predicate.PredicateInterceptor.handle(PredicateInterceptor.java:69)
      	at io.vertx.ext.web.client.impl.predicate.PredicateInterceptor.handle(PredicateInterceptor.java:32)
      	at io.vertx.ext.web.client.impl.HttpContext.next(HttpContext.java:267)
      	at io.vertx.ext.web.client.impl.HttpContext.fire(HttpContext.java:277)
      	at io.vertx.ext.web.client.impl.HttpContext.dispatchResponse(HttpContext.java:238)
      	at io.vertx.ext.web.client.impl.HttpContext.lambda$null$2(HttpContext.java:367)
      	at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:369)
      	at io.vertx.core.impl.WorkerContext.lambda$wrapTask$0(WorkerContext.java:35)
      	at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
      	at java.lang.Thread.run(Thread.java:748)
      

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                oleksandrkurash Alexander Kurash
                Reporter:
                zburke Zak_Burke
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases