Uploaded image for project: 'OpenICF'
  1. OpenICF
  2. OPENICF-967

ServiceNow: 'pagedResultsCookie' doesn't change when 'pagedResultsOffset' used in paging query request

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Component/s: ServiceNow Connector
    • Labels:
    • Environment:
      ServiceNowConnector: 1.5.1.0-SNAPSHOT afe43cba2e7,
      OpenIDM version "6.5.0-SNAPSHOT" 6f21de8,
      Linux Mint 18.2 64-bit,
      openjdk version "1.8.0_181"

      Description

      `pagedResulsCookie` value is the same for paging query without `pagedResultsOffset` and with `pagedResultsOffet`. But `pagedResultsCookie` should be different for these cases.

      Steps to reproduce:

      1. Download, unzip openidm, start openidm and set up serviceNow connector according documentation
      2. When exists less than 5 records in user table so create more records e.g.
        curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --header "Content-Type: application/json" --data '{"first_name": "FR_0", "last_name": "LN_10", "email": "UserTest_0_0@example.com", "phone": "555-123-1230", "user_name": "C_0_153854813958"}' --request POST "http://localhost:8080/openidm/system/serviceNow/user?_action=create"
        
        curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --header "Content-Type: application/json" --data '{"first_name": "FR_1", "last_name": "LN_9", "email": "UserTest_1_1@example.com", "phone": "555-123-1231", "user_name": "C_1_153854814204"}' --request POST "http://localhost:8080/openidm/system/serviceNow/user?_action=create" 
      3. SEND GET request without pageSize
        curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --request GET "http://localhost:8080/openidm/system/serviceNow/user?_queryFilter=True&_fields=last_name" | jq
        
        {
          "result": [
            {
              "_id": "06f97342c37030009b5efcfc5bba8fc3",
              "last_name": "User"
            },
            {
              "_id": "5136503cc611227c0183e96598c4f706",
              "last_name": "Guest"
            },
            {
              "_id": "6816f79cc0a8016401c5a33be04be441",
              "last_name": "Administrator"
            },
            {
              "_id": "7772a97e0fd71300760b06ace1050eb1",
              "last_name": "153855377050"
            },
            {
              "_id": "dd9b3742c37030009b5efcfc5bba8fb6",
              "last_name": "Admin"
            }
          ],
          "resultCount": 5,
          "pagedResultsCookie": null,
          "totalPagedResultsPolicy": "NONE",
          "totalPagedResults": -1,
          "remainingPagedResults": -1
        }
      4. SEND GET request with pageSize=2
        curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --request GET "http://localhost:8080/openidm/system/serviceNow/user?_queryFilter=True&_fields=last_name&_pageSize=2" | jq
        
        {
          "result": [
            {
              "_id": "06f97342c37030009b5efcfc5bba8fc3",
              "last_name": "User"
            },
            {
              "_id": "5136503cc611227c0183e96598c4f706",
              "last_name": "Guest"
            }
          ],
          "resultCount": 2,
          "pagedResultsCookie": "2",
          "totalPagedResultsPolicy": "NONE",
          "totalPagedResults": -1,
          "remainingPagedResults": -1
        }
      5. SEND GET request with pageSize=2 and with pagedResultsOffset=2
        curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --request GET "http://localhost:8080/openidm/system/serviceNow/user?_queryFilter=True&_fields=last_name&_pageSize=2&_pagedResultsOffset=2" | jq
        
        {
          "result": [
            {
              "_id": "6816f79cc0a8016401c5a33be04be441",
              "last_name": "Administrator"
            },
            {
              "_id": "7772a97e0fd71300760b06ace1050eb1",
              "last_name": "153855377050"
            }
          ],
          "resultCount": 2,
          "pagedResultsCookie": "2",
          "totalPagedResultsPolicy": "NONE",
          "totalPagedResults": -1,
          "remainingPagedResults": -1
        }

      Actual result: First 2 records were skipped, however `pagedResultsCookie` was same for both request (for with offset and for without offset).

      Expected result: First 2 records should be skipped and `pagedResultsCookie` should be different for request with skipped records and for request without skipped records.
      Note: For my case it could be `"pagedResultsCookie": "4"`.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                petr.jurica Petr Jurica [X] (Inactive)
                Reporter:
                miroslav.meca Miroslav Meca
                QA Assignee:
                Miroslav Meca
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: