Skip to content

Commit c6c2c09

Browse files
MODRTAC-119: Test updated rtac holdings response
1 parent fce5ef2 commit c6c2c09

File tree

3 files changed

+61
-1
lines changed

3 files changed

+61
-1
lines changed

edge-rtac/src/main/resources/core_platform/edge-rtac/features/rtac.feature

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,55 @@ Feature: rtac tests
230230
And match [expectedFirstHoldingsCopyNumber,expectedSecondHoldingsCopyNumber] contains call expectedData response.holdings,'holdings'
231231
And match [extInstanceId1,extInstanceId2] contains call expectedData response.holdings,'holdings'
232232

233+
Scenario: For periodical/serial, return holdings for each instance UUID included in request WHEN &fullPeriodicals=true
234+
* def extInstanceId1 = call random_uuid
235+
* def extServicePointId1 = call random_uuid
236+
* def extLocationId1 = call random_uuid
237+
* def expectedErrorMsg = 'Holdings not found for instance ' + extInstanceId1
238+
239+
# post first service point, location and instance
240+
* call read('classpath:core_platform/edge-rtac/features/util/initData.feature@PostInstance') { extInstanceId: #(extInstanceId1) }
241+
* call read('classpath:core_platform/edge-rtac/features/util/initData.feature@PostServicePoint') { extServicePointId: #(extServicePointId1) }
242+
* call read('classpath:core_platform/edge-rtac/features/util/initData.feature@PostLocation') { extLocationId: #(extLocationId1), extServicePointId: #(extServicePointId1) }
243+
244+
* def extInstanceId2 = call random_uuid
245+
* def extServicePointId2 = call random_uuid
246+
* def extLocationId2 = call random_uuid
247+
248+
# post second service point, location and instance
249+
* call read('classpath:core_platform/edge-rtac/features/util/initData.feature@PostInstance') { extInstanceId: #(extInstanceId2) }
250+
* call read('classpath:core_platform/edge-rtac/features/util/initData.feature@PostServicePoint') { extServicePointId: #(extServicePointId2) }
251+
* call read('classpath:core_platform/edge-rtac/features/util/initData.feature@PostLocation') { extLocationId: #(extLocationId2), extServicePointId: #(extServicePointId2) }
252+
253+
# post second holding
254+
* def extHoldingSourceId2 = call random_uuid
255+
* def extHoldingSourceName2 = call random_string
256+
* def extHoldingId2 = call random_uuid
257+
* def createHoldingsResponse = call read('classpath:core_platform/edge-rtac/features/util/initData.feature@PostHoldings') { extHoldingSourceId: #(extHoldingSourceId2), extHoldingSourceName: #(extHoldingSourceName2), extHoldingsRecordId: #(extHoldingId2), extLocationId: #(extLocationId2), extInstanceId: #(extInstanceId2) }
258+
* def expectedSecondHoldingsCopyNumber = createHoldingsResponse.copyNumber
259+
260+
# post item for the second holding
261+
* def extItemStatusName = 'Checked out'
262+
* def createSecondItemResponse = call read('classpath:core_platform/edge-rtac/features/util/initData.feature@PostItem') { extHoldingsRecordId: #(extHoldingId2), extStatusName: #(extItemStatusName)}
263+
* def expectedSecondItemId = createSecondItemResponse.id
264+
* def expectedSecondItemCopyNumber = createSecondItemResponse.copyNumber
265+
266+
Given url edgeUrl
267+
And path 'rtac'
268+
And param instanceIds = extInstanceId1 + ',' + extInstanceId2
269+
And param fullPeriodicals = true
270+
And param apikey = apikey
271+
And header Accept = 'application/json'
272+
When method GET
273+
Then status 200
274+
And assert response.holdings.length == 2
275+
And match [extInstanceId1,extInstanceId2] contains call expectedData response.holdings,'holdings'
276+
And match [expectedSecondItemId] contains call expectedData response.holdings,'holdings'
277+
And match [expectedSecondItemCopyNumber] contains call expectedData response.holdings,'holdings'
278+
And match [expectedSecondHoldingsCopyNumber] contains call expectedData response.holdings,'holdings'
279+
And match ['Checked out'] contains call expectedData response.holdings,'status'
280+
And match [expectedErrorMsg] contains call expectedData response.errors, 'message'
281+
233282
Scenario: If instance UUID is invalid then return an error response from batch endpoint
234283
# invalid instance UUID
235284
* def extInstanceId = '45dc40c1-46d9-4e41-b55c-c51e6f3e39b4'

edge-rtac/src/main/resources/core_platform/edge-rtac/features/util/initData.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ Feature: init data for edge-rtac
206206

207207
* def orderResponse = $
208208
* set orderResponse.workflowStatus = 'Open'
209+
* remove order.compositePoLines
209210

210211
Given path 'orders/composite-orders', extOrderId
211212
And request orderResponse

mod-password-validator/src/test/resources/karate-config.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ function fn() {
4444
} else if (env != null && env.match(/^ec2-\d+/)) {
4545
config.baseUrl = 'http://' + env + ':9130';
4646
config.admin = {tenant: 'supertenant', name: 'admin', password: 'admin'}
47-
}
47+
} else if (env == 'rancher') {
48+
config.baseUrl = 'https://folio-dev-dreamliner-okapi.ci.folio.org';
49+
config.edgeUrl = 'https://folio-dev-dreamliner-edge.ci.folio.org';
50+
config.apikey = 'eyJzIjoid2hhdHNpdCIsInQiOiJ0ZXN0cnRhYyIsInUiOiJ0ZXN0LXVzZXIifQ==';
51+
config.prototypeTenant='diku'
52+
config.admin = {
53+
tenant: 'diku',
54+
name: 'diku_admin',
55+
password: 'admin'
56+
}
57+
}
4858
return config;
4959
}

0 commit comments

Comments
 (0)