1158: Requisition comments should have similar JPA/Hibernate annotations as line items

Test Case #:284


Test Case Name: Requisition comments should have similar JPA/Hibernate annotations as line items

System: openLMIS

Subsystem: blue

Test case designed by: Lucyna Laska

Design Date:14.12.2016

Short description

  • Add additional annotation properties to comments field
  • Saving/updating a requisition with comments persists the attached comments as well as the requisition
  • If comments are removed from a requisition, they should be deleted

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       



Step

Action

Expected system response

Comment

1

 Create comment for requisition.

                                URL:http://test.openlmis.org/api/requisitions/d96eeb69-f6eb-4307-91a6-ded3398feac7/comments?access_token=ec47bdc1-7fcf-47d1-a8fc-aa3a6bd0f768

Method: POST

Body:

  {

    "requisition": {

      "id": "d96eeb69-f6eb-4307-91a6-ded3398feac7"

    },

    "body": "example body",

    "createdDate": [

      2016,

      12,

      14,

      7,

      33,

      9,

      313000000

    ]

  }



                                                                                                                            

                                                 

2

Create another comment to requisition.

URL:  http://test.openlmis.org/api/requisitions/d96eeb69-f6eb-4307-91a6-ded3398feac7/comments?access_token=ec47bdc1-7fcf-47d1-a8fc-aa3a6bd0f768

Method: POST

Body:

  {

    "requisition": {

      "id": "d96eeb69-f6eb-4307-91a6-ded3398feac7"

    },

    "body": "the second comment",

    "createdDate": [

      2016,

      12,

      14,

      7,

      33,

      9,

      313000000

    ]

  }




3

Check if requisition has created comments.

URL:   http://test.openlmis.org/api/requisitions/d96eeb69-f6eb-4307-91a6-ded3398feac7?access_token=ec47bdc1-7fcf-47d1-a8fc-aa3a6bd0f768

Method: GET


4

Update one of the comments mentioned above.

URL:  http://test.openlmis.org/api/requisitions/comments/b30fb8be-f9d0-4f7f-810a-e2c5736ca2d5?access_token=ec47bdc1-7fcf-47d1-a8fc-aa3a6bd0f768

Method: PUT

Body:

  {

    "id": "b30fb8be-f9d0-4f7f-810a-e2c5736ca2d5",

    "requisition": {

        "id": "d96eeb69-f6eb-4307-91a6-ded3398feac7" },

    "body": "the second comment TEST",

    "createdDate": [

      2016,

      12,

      14,

      14,

      0,

      53,

      479000000

    ]

  }

5

Check if comment is updated in requisition.

URL:   http://test.openlmis.org/api/requisitions/d96eeb69-f6eb-4307-91a6-ded3398feac7?access_token=ec47bdc1-7fcf-47d1-a8fc-aa3a6bd0f768

Method: GET



6

Get all comments for specified requisition.

URL: http://test.openlmis.org/api/requisitions/d96eeb69-f6eb-4307-91a6-ded3398feac7/comments?access_token=ec47bdc1-7fcf-47d1-a8fc-aa3a6bd0f768

Method: GET


7

Delete one of the comment mentioned above.

URL: http://test.openlmis.org/api/requisitions/comments/b30fb8be-f9d0-4f7f-810a-e2c5736ca2d5?access_token=ec47bdc1-7fcf-47d1-a8fc-aa3a6bd0f768

Method: DELETE



8

Check if deleted comments is not available on requisition details.

URL:  http://test.openlmis.org/api/requisitions/d96eeb69-f6eb-4307-91a6-ded3398feac7?access_token=ec47bdc1-7fcf-47d1-a8fc-aa3a6bd0f768

Method: GET


9

Check if the list of comments for specified requisition is updated.     

                                           URL: http://test.openlmis.org/api/requisitions/d96eeb69-f6eb-4307-91a6-ded3398feac7/comments?access_token=ec47bdc1-7fcf-47d1-a8fc-aa3a6bd0f768

Method: GET