@@ -230,6 +230,55 @@ Feature: rtac tests
230
230
And match [expectedFirstHoldingsCopyNumber,expectedSecondHoldingsCopyNumber] contains call expectedData response.holdings,'holdings'
231
231
And match [extInstanceId1,extInstanceId2] contains call expectedData response.holdings,'holdings'
232
232
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
+
233
282
Scenario : If instance UUID is invalid then return an error response from batch endpoint
234
283
# invalid instance UUID
235
284
* def extInstanceId = '45dc40c1-46d9-4e41-b55c-c51e6f3e39b4'
0 commit comments