Skip to content

Commit

Permalink
adding karate test for new entity type
Browse files Browse the repository at this point in the history
  • Loading branch information
kjain110 committed Dec 6, 2023
1 parent 3e9c7fd commit 176e22e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Feature: Entity types
* def itemEntityTypeId = '0cb79a4c-f7eb-4941-a104-745224ae0292'
* def loanEntityTypeId = '4e09d89a-44ed-418e-a9cc-820dfb27bf3a'
* def userEntityTypeId = '0069cf6f-2833-46db-8a51-8934769b8289'
* def purchaseOrderLinesEntityTypeId = '90403847-8c47-4f58-b117-9a807b052808'

Scenario: Get all entity types (no ids provided)
Given path 'entity-types'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Feature: Query
* def itemEntityTypeId = '0cb79a4c-f7eb-4941-a104-745224ae0292'
* def loanEntityTypeId = '4e09d89a-44ed-418e-a9cc-820dfb27bf3a'
* def userEntityTypeId = '0069cf6f-2833-46db-8a51-8934769b8289'
* def purchaseOrderLinesEntityTypeId = '90403847-8c47-4f58-b117-9a807b052808'

Scenario: Post query
Given path 'query'
Expand Down Expand Up @@ -245,6 +246,19 @@ Feature: Query
* def totalRecords = parseInt(response.totalRecords)
* assert totalRecords > 0

# Scenario: Run a query on the purchase order lines entity type
# * def queryRequest = { entityTypeId: '#(purchaseOrderLinesEntityTypeId)' , fqlQuery: '{\"$and\":[{\"purchase_order_line_payment_status\":{\"$eq\":\"Fully paid\"}}]}' }
# * def queryCall = call postQuery
# * def queryId = queryCall.queryId
#
# Given path 'query/' + queryId
# And params {includeResults: true, limit: 100, offset:0}
# When method GET
# Then status 200
# And match $.content contains deep {purchase_order_line_payment_status: 'Fully paid'}
# * def totalRecords = parseInt(response.totalRecords)
# * assert totalRecords > 0

Scenario: Run a query on the loans entity type
* def queryRequest = { entityTypeId: '#(itemEntityTypeId)' , fqlQuery: '{\"$and\":[{\"item_material_type\":{\"$in\":[\"book\", \"movie\"]}}]}' }
* def queryCall = call postQuery
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,18 @@ Feature: Add FQM query data
When method POST
Then status 201

# Add purchase order
* def orderId = call uuid1
* def orderRequest = {id: '#(orderId)', metadata: {createdDate: '2018-08-19T00:00:00.000+0000'}}
Given path '/orders-storage/purchase-orders'
And request orderRequest
When method POST
Then status 201

#Add Purchase Order Line
* def purchaseOrderLineId = call uuid1
* def purchaseOrderLineRequest = {id: '#(purchaseOrderLineId)', orderFormat:'P/E Mix' ,source:'User', purchaseOrderId:'#(orderId)', titleOrPackage: 'Kayak Fishing in the Northern Gulf Coast', paymentStatus: 'Fully Paid'}
Given path '/orders-storage/po-lines'
And request purchaseOrderLineRequest
When method POST
Then status 201
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Feature: mod-fqm-manager integration tests
| 'mod-inventory-storage' |
| 'mod-circulation-storage' |
| 'mod-fqm-manager' |
| 'mod-finance-storage' |
| 'mod-orders-storage' |


* table userPermissions
| name |
Expand All @@ -30,6 +33,8 @@ Feature: mod-fqm-manager integration tests
| 'fqm.query.all' |
| 'fqm.query.purge' |
| 'fqm.materializedViews.post' |
| 'orders-storage.purchase-orders.item.post' |
| 'orders-storage.po-lines.item.post' |

Scenario: create tenant and users for testing
Given call read('classpath:common/setup-users.feature')
Expand Down

0 comments on commit 176e22e

Please sign in to comment.