Uploaded image for project: 'mod-rtac'
  1. mod-rtac
  2. MODRTAC-64

RTAC-batch: Wrong response for not-existing instance

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • P2
    • Resolution: Done
    • None
    • 3.0.2, 3.1.0
    • None
    • Prokopovych - Sprint 119, Prokopovych - Sprint 120
    • 3
    • Prokopovych
    • R2 2021 Bugfix

    Description

      Step to reproduce:
      Call POST /rtac-batch with body

      { "instanceIds": [ "a731f607-c3be-45a7-92d2-9465e209658a" ], "fullPeriodicals" : false }
      

       

      There is no instance for provided UUID.
      The request takes a long time (suggesting a timeout is eventually exceeded), then we get the following response:

       

      { "holdings": [], "errors": null }

       

      The problem place here https://github.com/folio-org/mod-rtac/blob/e6ee4ddec46011ad1d3320d73484dd65556be012/src/main/java/org/folio/clients/InventoryClient.java#L80. As the body is empty the response is handled incorrect.

      if we call with this body

       

      { "instanceIds": [ "5bf370e0-8cca-4d9c-82e4-5170ab2a0a39", "a731f607-c3be-45a7-92d2-9465e209658a" ], "fullPeriodicals" : false }

       

      we get:

       

      {
       "holdings": [
       {
       "instanceId": "5bf370e0-8cca-4d9c-82e4-5170ab2a0a39",
       "holdings": [
      { "id": "100d10bf-2f06-4aa0-be15-0b95b2d9f9e3", "location": "Annex", "callNumber": "TK5105.88815 . A58 2004 FT MEADE", "status": "Available", "permanentLoanType": "Can circulate" }
      ,
      { "id": "7212ba6a-8dcf-45a1-be9a-ffaa847c4423", "location": "Main Library", "callNumber": "TK5105.88815 . A58 2004 FT MEADE", "status": "Available", "permanentLoanType": "Can circulate" }
      ]
       }
       ],
       "errors": [
      { "message": "Instance a731f607-c3be-45a7-92d2-9465e209658a can not be retrieved", "code": "404" }
      ]
       }

       

      Actual response:

      { "holdings": [], "errors": null }

      Expected response:

      {
       "holdings": [],
       "errors": [
      { "message": "Instance 7212ba6a-8dcf-45a1-be9a-ffaa847c4423 can not be retrieved", "code": "404" }
      ]
       }

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                marcjohnson Marc Johnson
                Roman_Leshchenko Roman Leshchenko
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases