872: Fix search endpoints to use query parameters
Test Case #:872
Test Case Name: Fix search endpoints to use query parameters | |
System: OpenLMIS | Subsystem:requisition |
Test case designed by: Lucyna Kwidzińska | Design Date:16.08.2016 |
Short description: We currently have got several search endpoints, that go against the OpenLMIS v3 style guide and use specific paths for every parameter search, instead of query parameters. We should find all of those endpoints and refactor them to accept query parameters (take into consideration that some parameters may be required and some not).
|
|
Pre – conditions: |
Step | Action | Expected system response | Comment |
1 | Request a token from authentication service with some rest client: | Token has been generated. | Copy the token from response (e.g. {"access_token":"121d02ed-b6b4-4233-9566-cac2b8a3aec9"...). |
2 | Search Order by parameters: /orders/search?supplyingFacility=x&requestingFacility=x&program=x parameters:
example URL: Method: GET | Searching the order is possible. |
|
3 | Verify if searching the Order will be possible without required parameter (supplyingFacility). Method: GET |
Searching the order is not possible without required paramater. | |
4 | Search User by parameters:
Method: GET | Searching the user is possible. |
|
5 | Search ProductCategory by parameters:
example URL: http://localhost:8080/api/productCategories/search?code=code1&access_token=83b5f01a-db20-420e-9e38-efc9ed8a2849 Method: GET | Searching the productCategory is possible. |
|
6 | Search Period by parameters:
Method: GET | Searching the period is possible. |
|
7 | Verify if searching the Period will be possible without required parameter (processingSchedule). example URL: http://localhost:8080/api/periods/search?toDate=2016-08-18&access_token=83b5f01a-db20-420e-9e38-efc9ed8a2849 Method: GET | Searching the period is not possible withour required parameter. | |
8 | Search ProgramProduct by parameters:
Method: GET | Searching the programProduct is possible. | |
9 | Verify if searching the programProduct will be possible without required parameter (program).
example URL: http://localhost:8080/api/programProducts/search?fullSupply=true&access_token=83b5f01a-db20-420e-9e38-efc9ed8a2849 Method: GET | Searching the programProduct is not possible without required parameter. | |
10 | Search Stock by parameters:
Method: GET | Searching the stock is possible. |
|
11 | Search SupplyLine by parameters:
method: GET | Searching the supplyLine is possible. |
|
12 | Verify if searching the supplyLine will be possible without one of the required parameters (program or supervisoryNode). Method: GET | Searching the supplyLine is not possible without required parameter. | |
13 | Search RequisitionLine by parameters:
Method: GET | Searching the requisitionLine is possible. |
|
14 | Verify if searching the requisitionLine will be possible without one of the required parameters (requisition or product). Method: GET
| Searching the requisitionLine is not possible without required parameter. | |
15 | Search Requisition by parameters:
example URL: Method: GET | Searching the requisition is possible.
|
|
16 | Search RequisitionTemplate by parameters:
method: GET | Searching the requisitionTemplate is possible. |
Post – conditions: |
OpenLMIS: the global initiative for powerful LMIS software