Skip to content

Commit

Permalink
MODRTAC-119: Test updated rtac holdings response
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuf-murodov-epam committed Feb 13, 2025
1 parent fce5ef2 commit c6c2c09
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,55 @@ Feature: rtac tests
And match [expectedFirstHoldingsCopyNumber,expectedSecondHoldingsCopyNumber] contains call expectedData response.holdings,'holdings'
And match [extInstanceId1,extInstanceId2] contains call expectedData response.holdings,'holdings'

Scenario: For periodical/serial, return holdings for each instance UUID included in request WHEN &fullPeriodicals=true
* def extInstanceId1 = call random_uuid
* def extServicePointId1 = call random_uuid
* def extLocationId1 = call random_uuid
* def expectedErrorMsg = 'Holdings not found for instance ' + extInstanceId1

# post first service point, location and instance
* call read('classpath:core_platform/edge-rtac/features/util/initData.feature@PostInstance') { extInstanceId: #(extInstanceId1) }
* call read('classpath:core_platform/edge-rtac/features/util/initData.feature@PostServicePoint') { extServicePointId: #(extServicePointId1) }
* call read('classpath:core_platform/edge-rtac/features/util/initData.feature@PostLocation') { extLocationId: #(extLocationId1), extServicePointId: #(extServicePointId1) }

* def extInstanceId2 = call random_uuid
* def extServicePointId2 = call random_uuid
* def extLocationId2 = call random_uuid

# post second service point, location and instance
* call read('classpath:core_platform/edge-rtac/features/util/initData.feature@PostInstance') { extInstanceId: #(extInstanceId2) }
* call read('classpath:core_platform/edge-rtac/features/util/initData.feature@PostServicePoint') { extServicePointId: #(extServicePointId2) }
* call read('classpath:core_platform/edge-rtac/features/util/initData.feature@PostLocation') { extLocationId: #(extLocationId2), extServicePointId: #(extServicePointId2) }

# post second holding
* def extHoldingSourceId2 = call random_uuid
* def extHoldingSourceName2 = call random_string
* def extHoldingId2 = call random_uuid
* def createHoldingsResponse = call read('classpath:core_platform/edge-rtac/features/util/initData.feature@PostHoldings') { extHoldingSourceId: #(extHoldingSourceId2), extHoldingSourceName: #(extHoldingSourceName2), extHoldingsRecordId: #(extHoldingId2), extLocationId: #(extLocationId2), extInstanceId: #(extInstanceId2) }
* def expectedSecondHoldingsCopyNumber = createHoldingsResponse.copyNumber

# post item for the second holding
* def extItemStatusName = 'Checked out'
* def createSecondItemResponse = call read('classpath:core_platform/edge-rtac/features/util/initData.feature@PostItem') { extHoldingsRecordId: #(extHoldingId2), extStatusName: #(extItemStatusName)}
* def expectedSecondItemId = createSecondItemResponse.id
* def expectedSecondItemCopyNumber = createSecondItemResponse.copyNumber

Given url edgeUrl
And path 'rtac'
And param instanceIds = extInstanceId1 + ',' + extInstanceId2
And param fullPeriodicals = true
And param apikey = apikey
And header Accept = 'application/json'
When method GET
Then status 200
And assert response.holdings.length == 2
And match [extInstanceId1,extInstanceId2] contains call expectedData response.holdings,'holdings'
And match [expectedSecondItemId] contains call expectedData response.holdings,'holdings'
And match [expectedSecondItemCopyNumber] contains call expectedData response.holdings,'holdings'
And match [expectedSecondHoldingsCopyNumber] contains call expectedData response.holdings,'holdings'
And match ['Checked out'] contains call expectedData response.holdings,'status'
And match [expectedErrorMsg] contains call expectedData response.errors, 'message'

Scenario: If instance UUID is invalid then return an error response from batch endpoint
# invalid instance UUID
* def extInstanceId = '45dc40c1-46d9-4e41-b55c-c51e6f3e39b4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ Feature: init data for edge-rtac

* def orderResponse = $
* set orderResponse.workflowStatus = 'Open'
* remove order.compositePoLines

Given path 'orders/composite-orders', extOrderId
And request orderResponse
Expand Down
12 changes: 11 additions & 1 deletion mod-password-validator/src/test/resources/karate-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ function fn() {
} else if (env != null && env.match(/^ec2-\d+/)) {
config.baseUrl = 'http://' + env + ':9130';
config.admin = {tenant: 'supertenant', name: 'admin', password: 'admin'}
}
} else if (env == 'rancher') {
config.baseUrl = 'https://folio-dev-dreamliner-okapi.ci.folio.org';
config.edgeUrl = 'https://folio-dev-dreamliner-edge.ci.folio.org';
config.apikey = 'eyJzIjoid2hhdHNpdCIsInQiOiJ0ZXN0cnRhYyIsInUiOiJ0ZXN0LXVzZXIifQ==';
config.prototypeTenant='diku'
config.admin = {
tenant: 'diku',
name: 'diku_admin',
password: 'admin'
}
}
return config;
}

0 comments on commit c6c2c09

Please sign in to comment.