Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable test #1275

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ Feature: rtac tests
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostInstance')
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostServicePoint')
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostLocation')
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostHoldings')
* def createHoldingsResponse = call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostHoldings')
* def expectedHoldingsCopyNumber = createHoldingsResponse.copyNumber
* def createFirstItemResponse = call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostItem')
* def expectedFirstItemId = createFirstItemResponse.itemId
* def expectedFirstItemCopyNumber = createFirstItemResponse.copyNumber
* def itemStatusName = 'Checked out'
* def createSecondItemResponse = call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostItem')
* def expectedSecondItemId = createSecondItemResponse.itemId
* def expectedSecondItemCopyNumber = createSecondItemResponse.copyNumber

Given url edgeUrl
And path 'rtac/' + instanceId
Expand All @@ -38,6 +41,7 @@ Feature: rtac tests
And match response.holdings.holding.length == 2
# api response is getting shuffled for each run, matching response by converting into an array.
And match [expectedFirstItemId,expectedSecondItemId] contains call expectedData response.holdings,'holdings'
And match [expectedHoldingsCopyNumber,expectedFirstItemCopyNumber,expectedSecondItemCopyNumber] contains call expectedData response.holdings,'holdings'
And match ['Available','Checked out'] contains call expectedData response.holdings,'status'
# deleteItem
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@DeleteItems')
Expand All @@ -51,19 +55,23 @@ Feature: rtac tests
* def instanceId = firstInstanceId
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostServicePoint')
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostLocation')
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostHoldings')
* def createFirstHoldingsResponse = call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostHoldings')
* def expectedFirstHoldingsCopyNumber = createFirstHoldingsResponse.copyNumber;
* def createFirstItemResponse = call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostItem')
* def expectedFirstItemId = createFirstItemResponse.itemId
* def expectedFirstItemCopyNumber = createFirstItemResponse.copyNumber;
# 2nd instance
* def createInstanceResponse = call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostInstance')
* def secondInstanceId = createInstanceResponse.instanceEntityRequest.id
* def instanceId = secondInstanceId
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostServicePoint')
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostLocation')
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostHoldings')
* def createSecondHoldingsResponse = call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostHoldings')
* def expectedSecondHoldingsCopyNumber = createSecondHoldingsResponse.copyNumber;
* def itemStatusName = 'Checked out'
* def createSecondItemResponse = call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostItem')
* def expectedSecondItemId = createSecondItemResponse.itemId
* def expectedSecondItemCopyNumber = createSecondItemResponse.copyNumber;

Given url edgeUrl
And path 'rtac?instanceIds=' + firstInstanceId + ',' + secondInstanceId
Expand All @@ -74,6 +82,8 @@ Feature: rtac tests
And match response.instances.holdings.length == 2
And match [firstInstanceId,secondInstanceId] contains call expectedData response.instances.holdings,'instances'
And match [expectedFirstItemId,expectedSecondItemId] contains call expectedData response.instances.holdings,'holdings'
And match [expectedFirstItemCopyNumber,expectedSecondItemCopyNumber] contains call expectedData response.instances.holdings,'holdings'
And match [expectedFirstHoldingsCopyNumber,expectedSecondHoldingsCopyNumber] contains call expectedData response.instances.holdings,'holdings'
And match ['Available','Checked out'] contains call expectedData response.instances.holdings,'status'
# deleteItem
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@DeleteItems')
Expand All @@ -87,7 +97,8 @@ Feature: rtac tests
* def instanceId = firstInstanceId
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostServicePoint')
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostLocation')
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostHoldings')
* def createFirstHoldingsResponse = call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostHoldings')
* def expectedFirstHoldingsCopyNumber = createFirstHoldingsResponse.copyNumber;
* def createFirstItemResponse = call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostItem')
* def expectedFirstItemId = createFirstItemResponse.itemId
# 2nd instance
Expand All @@ -96,7 +107,8 @@ Feature: rtac tests
* def instanceId = secondInstanceId
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostServicePoint')
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostLocation')
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostHoldings')
* def createSecondHoldingsResponse = call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostHoldings')
* def expectedSecondHoldingsCopyNumber = createSecondHoldingsResponse.copyNumber;
* def itemStatusName = 'Checked out'
* def createSecondItemResponse = call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostItem')
* def expectedSecondItemId = createSecondItemResponse.itemId
Expand All @@ -110,12 +122,15 @@ Feature: rtac tests
And match response.instances.holdings.length == 2
And match [firstInstanceId,secondInstanceId] contains call expectedData response.instances.holdings,'instances'
And match [expectedFirstItemId,expectedSecondItemId] contains call expectedData response.instances.holdings,'holdings'
And match [expectedFirstItemCopyNumber,expectedSecondItemCopyNumber] contains call expectedData response.instances.holdings,'holdings'
And match [expectedFirstHoldingsCopyNumber,expectedSecondHoldingsCopyNumber] contains call expectedData response.instances.holdings,'holdings'
And match ['Available','Checked out'] contains call expectedData response.instances.holdings,'status'
# deleteItem
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@DeleteItems')
# delete newspaper MaterialType
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@DeleteMaterialType')
Scenario: For periodical/serial, return only holdings information including availability for each instance UUID included in request WHEN &fullPeriodicals=false OR no parameter is omitted

Scenario: For periodical/serial, return only holdings information including availability for each instance UUID included in request WHEN &fullPeriodicals=false OR no parameter is omitted
# 1st instance
# create journal materialType
* def materialTypeName = 'journal'
Expand All @@ -131,6 +146,7 @@ Feature: rtac tests
* def firstHoldings = call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostHoldings')
* def firstHoldingsId = firstHoldings.response.id
* def holdingId = firstHoldingsId
* def firstHoldingsCopyNumber = firstHoldings.copyNumber
* def createFirstItemResponse = call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostItem')
* def expectedFirstItemId = createFirstItemResponse.itemId
# 2nd instance
Expand All @@ -142,6 +158,7 @@ Feature: rtac tests
* def secondHoldings = call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostHoldings')
* def secondHoldingsId = secondHoldings.response.id
* def holdingId = secondHoldingsId
* def secondHoldingsCopyNumber = secondHoldings.copyNumber
* def createSecondItemResponse = call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@PostItem')
* def expectedSecondItemId = createSecondItemResponse.itemId

Expand All @@ -153,6 +170,7 @@ Feature: rtac tests
Then status 200
And match response.instances.holdings.length == 2
And match [firstHoldingsId,secondHoldingsId] contains call expectedData response.instances.holdings,'holdings'
And match [firstHoldingsCopyNumber,secondHoldingsCopyNumber] contains call expectedData response.instances.holdings,'holdings'
And match [firstInstanceId,secondInstanceId] contains call expectedData response.instances.holdings,'instances'
# deleteItem
* call read('classpath:prokopovych/edge-rtac/features/util/initData.feature@DeleteItems')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"id": "#(holdingId)",
"instanceId": "#(instanceId)",
"permanentLocationId": "#(locationId)"
"permanentLocationId": "#(locationId)",
"copyNumber": "1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
},
"status": {
"name": "#(itemStatusName)"
}
},
"copyNumber": "1"
}
1 change: 1 addition & 0 deletions edge-rtac/src/main/resources/karate-config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
function fn() {

karate.configure('logPrettyRequest', true);
karate.configure('logPrettyResponse', true);
var retryConfig = { count: 20, interval: 30000 }
karate.configure('retry', retryConfig)

Expand Down
1 change: 1 addition & 0 deletions edge-rtac/src/main/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="LOG_FILE" value="target/karate.log"/>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
Expand Down
5 changes: 2 additions & 3 deletions edge-rtac/src/test/java/org/folio/EdgeRtacTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

@Disabled
@FolioTest(team = "prokopovych", module = "edge-rtac")
class EdgeRtacTests extends TestBase {

public EdgeRtacTests() {
super(new TestIntegrationService(new TestModuleConfiguration("classpath:prokopovych/edge-rtac/features/")));
super(new TestIntegrationService(new TestModuleConfiguration("classpath:core_platform/edge-rtac/features/")));
}

@BeforeAll
public void setup() {
runFeature("classpath:prokopovych/edge-rtac/rtac-junit.feature");
runFeature("classpath:core_platform/edge-rtac/rtac-junit.feature");
}

@Test
Expand Down