1688: Get user fulfillment facilities should query by rightId


Test Case #:1688

Test Case Name:Get user fulfillment facilities should query by rightId

System: OpenLMIS

Subsystem: blue

Test case designed by: Paulina Borowa

Design Date:26.01.2017

Short description:  

The GET /users/<userId>/fulfillmentFacilities API has an incorrect interface; it should have rightId as a request parameter. It should answer the question: for this user, what are the warehouses where I have this right? As it currently is, it returns all warehouses where this user has any fulfillment right.

A similar refactoring was done for /users/<userId>/supervisedFacilities in OLMIS-1162 Done .

Acceptance Criteria

  • This endpoint has a new request parameter, rightId
  • Code is changed to look for this right specifically, and not just any fulfillment right
  • RAML is updated, integration tests pass

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                     

 

 

Step

Action

Expected system response

Comment

1

 Check if: This endpoint has a new request parameter, rightId

                                                                                                                          

                                                 

2

 Check situation with no existing rightId

 

 

3

Check situation when user don't have right

empty list Status 200 OK 

 

4

Check if correctly facility is listed when property rightId are used 

 Results for admin user

 Results for wclerk user:


roleAssignments for  for Admin user:

{

      "roleId": "185db8f7-ee35-44d0-8b40-6de12489ae77",

      "programCode": "PRG001",

      "supervisoryNodeCode": "SN1"

    },

    {

      "roleId": "185db8f7-ee35-44d0-8b40-6de12489ae77",

      "programCode": "PRG002",

      "supervisoryNodeCode": "SN2"

    },

    {

      "roleId": "2c3e59f2-6630-4e6d-b98a-4ed427ed778d",

      "programCode": "PRG001",

      "supervisoryNodeCode": "SN1.1"

    },

    {

      "roleId": "2c3e59f2-6630-4e6d-b98a-4ed427ed778d",

      "programCode": "PRG002",

      "supervisoryNodeCode": "SN1.1"

    },

    {

      "roleId": "e16d802b-8eb1-43f7-adf8-ef123227cb88",

      "warehouseCode": "WH01"

    },

    {

      "roleId": "2a2eaeba-bb9a-11e6-a4a6-cec0c932ce01",

      "programCode": "PRG001"

    },

    {

      "roleId": "2a2eaeba-bb9a-11e6-a4a6-cec0c932ce01",

      "programCode": "PRG002"

    },

    {

      "roleId": "d30a2fbb-51d9-49ad-90fe-fb405470a439",

      "programCode": "PRG002",

      "supervisoryNodeCode": "SN1"

    },

    {

      "roleId": "d30a2fbb-51d9-49ad-90fe-fb405470a439",

      "programCode": "PRG001",

      "supervisoryNodeCode": "SN1"

    },

    {

      "roleId": "e16d802b-8eb1-43f7-adf8-ef123227cb88",

      "warehouseCode": "WH02"

    },

    {

      "roleId": "b6134c01-cb37-4303-85f0-8c8eab9d3cec",

      "programCode": "PRG001",

      "supervisoryNodeCode": "SN1"

    },

    {

      "roleId": "b6134c01-cb37-4303-85f0-8c8eab9d3cec",

      "programCode": "PRG002",

      "supervisoryNodeCode": "SN2"

    },

    {

      "roleId": "2c3e59f2-6630-4e6d-b98a-4ed427ed778d",

      "programCode": "PRG002",

      "supervisoryNodeCode": "SN2"

    },

    {

      "roleId": "a439c5de-b8aa-11e6-80f5-76304dec7eb7"

    },

    {

      "roleId": "2c3e59f2-6630-4e6d-b98a-4ed427ed778d",

      "programCode": "PRG001",

      "supervisoryNodeCode": "SN2"

    }

5

   

roleAssignments for wclerk user

      {

        "roleId": "e16d802b-8eb1-43f7-adf8-ef123227cb88",

        "warehouseCode": "WH01"

      }

6

  

 

OpenLMIS: the global initiative for powerful LMIS software