845: Change value of cascade parameter in ManyToOne annotations

Test Case #:845

 

Test Case Name: Change value of cascade parameter in ManyToOne annotations

System: OpenLMIS

Subsystem: requisition

Test case designed by: Lucyna Kwidzińska

Design Date:26.07.2016

Short description

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       

 

 

Step

Action

Expected system response

Comment

1

                                                         

Create geographicLevel

URL: http://localhost:8080/api/geographicLevels

Method: POST

 

Example Body:

{

"code": "levelcode",

"levelNumber": "14"

}

                                                                                                              

  status: 201 created,

geographicLevel id: "http://localhost:8080/api/geographicLevels/943585a3-6a77-4120-918a-21a306a74b57"

                  

                                                 

2

Create geographicZone

URL: http://localhost:8080/api/geographicZones

Method: POST

 

Example body:

{

"code": "zonecode",

"name": "zonename",

"level": "http://localhost:8080/api/geographicLevels/943585a3-6a77-4120-918a-21a306a74b57"

 

}

 

  status: 201 created, 

geographicZone id: "http://localhost:8080/api/geographicZones/610cef4a-9178-4199-ab51-dd8cc91661f4"

 

3

Create FacilityType

URL: http://localhost:8080/api/facilityTypes

Method: POST

 

Example Body:

{

"code": "manyfacilitytypes"

}

 

status: 201 created,

facilityType id: "http://localhost:8080/api/facilityTypes/634d8b8f-3cbd-44c0-8b70-107cea7f2759"

 

4

Create Facility.

URL: http://localhost:8080/api/facilities

Method: POST

 

Example body:

{

"code": "newfacilitycode",

"geographicZone": "http://localhost:8080/api/geographicZones/610cef4a-9178-4199-ab51-dd8cc91661f4",

"type": "http://localhost:8080/api/facilityTypes/634d8b8f-3cbd-44c0-8b70-107cea7f2759",

"active": "true",

"enabled": "true"

}

 

 status: 201 created,

facility id: "http://localhost:8080/api/facilities/b55cc670-1b6b-434d-afb2-cee55e9b4a98"

 

5

Create program (two times with different values → like example below)

URL: http://localhost:8080/api/programs

Method: POST

Example body:

{

"code": "oneprogram",

"periodsSkippable": "true"

}

 

status: 201 created,

a) program I,

"http://localhost:8080/api/programs/b0bf6090-204c-4b8d-9051-eddde862484c"

b) program II,

"http://localhost:8080/api/programs/74286058-c108-48b0-8097-1f7435b7a5cd"

 

6

Create schedule (two times with different values → like example below)

URL: http://localhost:8080/api/schedules

Method: POST

 

Example body:

{

"code": "onecode01",

"name": "onename01"

}

 

status: 201 created,

a) schedule I,

id: "http://localhost:8080/api/schedules/b34deff6-33b3-4247-9a0e-372cc57ce58e"

b) schedule II,

id: "http://localhost:8080/api/schedules/8fbdac5f-79fa-40c2-8fbf-2a3259d0ae0f"

 

7

Create period (two times with different values → like example below)

URL: http://localhost:8080/api/periods

Method: POST

 

Example Body:

{

"processingSchedule": {

"id": "b34deff6-33b3-4247-9a0e-372cc57ce58e",

"code": "onecode01",

"name": "onename01"

},

"name": "onenameperiod",

"startDate": "2016-07-30",

"endDate": "2016-08-01"

}

status: 201 created,

a) period I:

id: "http://localhost:8080/api/periods/b7aa89dd-7548-4196-8231-b85e85030ef0",

b) period II,

id: "http://localhost:8080/api/periods/ac04a37f-4e2d-465b-a709-5623670cf36b"

 

8

Verify if it's a possibility to create the requisitions with the same facility.  

URL: http://localhost:8080/api/requisitions

Method: POST

a)

Example body:

{

"facility": "http://localhost:8080/api/facilities/b55cc670-1b6b-434d-afb2-cee55e9b4a98",

"program": "http://localhost:8080/api/programs/b0bf6090-204c-4b8d-9051-eddde862484c",

"processingPeriod": "http://localhost:8080/api/periods/b7aa89dd-7548-4196-8231-b85e85030ef0",

"status": "INITIATED"

}

b)

Example Body:

{

"facility": "http://localhost:8080/api/facilities/b55cc670-1b6b-434d-afb2-cee55e9b4a98",

"program": "http://localhost:8080/api/programs/74286058-c108-48b0-8097-1f7435b7a5cd",

"processingPeriod": "http://localhost:8080/api/periods/ac04a37f-4e2d-465b-a709-5623670cf36b",

"status": "INITIATED"

 

}

a) status: 201 created,

 

 

b) status: 201 created,

 

Two requisitions was created with the same facility. Values for program and processingPeriod are different.

 

 

Post – conditions:

OpenLMIS: the global initiative for powerful LMIS software