Commit fc7d8548 authored by NSarda's avatar NSarda
Browse files

Add new test cases with payloads and step defs

parent d7201905
Pipeline #33957 passed with stages
in 24 minutes and 3 seconds
......@@ -35,8 +35,10 @@ public class AutomationConstants {
public static final List<String> OS_TARGET_SCHEMA_KIND_AT_LOG = Arrays.asList("slb:wks:log:1.0.0", "abc:wks:log:1.0.7", "slb:wks:well:1.0.0", "slb:wks:log:4.0.0");
public static final List<String> OS_TARGET_SCHEMA_KIND_AT_WELL = Arrays.asList("slb:wks:well:1.0.0", "slb:wks:wellbore:1.0.0");
public static final List<String> OS_TARGET_SCHEMA_KIND_OGA_LOG = Arrays.asList("slb:wks:log:1.0.0", "slb:wks:well:1.0.0");
public static final List<String> OS_TARGET_SCHEMA_KIND_PETREL_WELLSET = Arrays.asList("slb:wks:well:1.0.0", "abc:wks:well:1.0.0");
public static final List<String> OS_TARGET_SCHEMA_KIND_AT_LOGSET = Arrays.asList("slb:wks:log:1.0.0", "abc:wks:log:1.0.0");
public static final List<String> OS_TARGET_SCHEMA_KIND_PETREL_WELLSET = Arrays.asList("slb:wks:wellset:1.0.0", "slb:wks:wellbore:1.0.0");
public static final List<String> OS_TARGET_SCHEMA_KIND_AT_LOGSET = Arrays.asList("slb:wks:logset:1.0.0", "slb:wks:well:1.0.0");
public static final List<String> OS_TARGET_SCHEMA_KIND_PETREL_WELLSET1 = Arrays.asList("slb:wks:well:1.0.0", "abc:wks:well:1.0.0");
public static final List<String> OS_TARGET_SCHEMA_KIND_AT_LOGSET1 = Arrays.asList("slb:wks:log:1.0.0", "abc:wks:log:1.0.0");
public static final long INDEXING_TIMEOUT = 60;
public static final String TENANT_NAME_PLACEHOLDER = "<tenant_name>";
public static final String ACL_VIEWERS_GROUP = "<acl_viewers>";
......
......@@ -197,6 +197,8 @@ public class IntegrationTestStepDefs implements En {
And("Wks record should be created in the intended kind", () -> {
String expectedKind = AutomationConstants.OS_TARGET_SCHEMA_KIND_TENANT;
String actualKind = new JsonPath(this.context.getHttpResponse().getBody()).get("kind").toString();
System.out.println("expectedKind : " + expectedKind);
System.out.println("actualKind : " + actualKind);
assertEquals(expectedKind, actualKind);
});
......@@ -449,11 +451,17 @@ public class IntegrationTestStepDefs implements En {
});
And("I verify that multiple wks records are created for each of the above raw records having same autority and different entities", () -> {
checkMultipleWKSRecordsCreatedForEachKind(AutomationConstants.OS_TARGET_SCHEMA_KIND_AT_WELL);
checkMultipleWKSRecordsCreatedForEachKindForSecondRecord(AutomationConstants.OS_TARGET_SCHEMA_KIND_OGA_LOG);
checkMultipleWKSRecordsCreatedForEachKind(AutomationConstants.OS_TARGET_SCHEMA_KIND_PETREL_WELLSET);
checkMultipleWKSRecordsCreatedForEachKindForSecondRecord(AutomationConstants.OS_TARGET_SCHEMA_KIND_AT_LOGSET);
});
And("I verify that multiple wks records are created for each of the above raw records having same autority", () -> {
checkMultipleWKSRecordsCreatedForEachKind(AutomationConstants.OS_TARGET_SCHEMA_KIND_PETREL_WELLSET1);
checkMultipleWKSRecordsCreatedForEachKindForSecondRecord(AutomationConstants.OS_TARGET_SCHEMA_KIND_AT_LOGSET1);
});
Given("I hit wks service with {string} whose raw record contains relationship to above records",
(String inputPayload) -> {
persistRecordWithRelationshipBlock(inputPayload);
......@@ -475,7 +483,9 @@ public class IntegrationTestStepDefs implements En {
List<String> ids = extractRecordIdFromPayload(inputPayload);
List<String> wksRecordIdsInRelationshipBlock = new ArrayList<>();
for(String id : ids) {
if(id.contains("well"))
wksRecordIdsInRelationshipBlock.add(this.createWKSRecordId(id, AutomationConstants.OS_TARGET_SCHEMA_KIND_PETREL_WELL.get(3)));
else
wksRecordIdsInRelationshipBlock.add(this.createWKSRecordId(id, AutomationConstants.OS_TARGET_SCHEMA_KIND_AT_LOG.get(3)));
}
verifyRelationshipsBlockOfWksCreated(expectedRelationshipBlock, wksRecordIdsInRelationshipBlock, AutomationConstants.OS_TARGET_SCHEMA_KIND);
......@@ -486,9 +496,11 @@ public class IntegrationTestStepDefs implements En {
List<String> ids = extractRecordIdFromPayload(inputPayload);
List<String> wksRecordIdsInRelationshipBlock = new ArrayList<>();
for(String id : ids) {
wksRecordIdsInRelationshipBlock.add(this.createWKSRecordId(id, AutomationConstants.OS_TARGET_SCHEMA_KIND_AT_WELL.get(0)));
wksRecordIdsInRelationshipBlock.add(this.createWKSRecordId(id, AutomationConstants.OS_TARGET_SCHEMA_KIND_OGA_LOG.get(0)));
}
if(id.contains("wellset")) {
wksRecordIdsInRelationshipBlock.add(this.createWKSRecordId(id, AutomationConstants.OS_TARGET_SCHEMA_KIND_PETREL_WELLSET.get(0)));
}else {
wksRecordIdsInRelationshipBlock.add(this.createWKSRecordId(id, AutomationConstants.OS_TARGET_SCHEMA_KIND_AT_LOGSET.get(0)));
}}
verifyRelationshipsBlockOfWksCreated(expectedRelationshipBlock, wksRecordIdsInRelationshipBlock, AutomationConstants.OS_TARGET_SCHEMA_KIND);
});
......@@ -497,8 +509,11 @@ public class IntegrationTestStepDefs implements En {
List<String> ids = extractRecordIdFromPayload(inputPayload);
List<String> wksRecordIdsInRelationshipBlock = new ArrayList<>();
for(String id : ids) {
wksRecordIdsInRelationshipBlock.add(this.createWKSRecordId(id, AutomationConstants.OS_TARGET_SCHEMA_KIND_PETREL_WELLSET.get(0)));
wksRecordIdsInRelationshipBlock.add(this.createWKSRecordId(id, AutomationConstants.OS_TARGET_SCHEMA_KIND_AT_LOGSET.get(0)));
if(id.contains("wellset1"))
wksRecordIdsInRelationshipBlock.add(this.createWKSRecordId(id, AutomationConstants.OS_TARGET_SCHEMA_KIND_PETREL_WELLSET1.get(0)));
else
wksRecordIdsInRelationshipBlock.add(this.createWKSRecordId(id, AutomationConstants.OS_TARGET_SCHEMA_KIND_AT_LOGSET1.get(0)));
}
verifyRelationshipsBlockOfWksCreated(expectedRelationshipBlock, wksRecordIdsInRelationshipBlock, AutomationConstants.OS_TARGET_SCHEMA_KIND);
});
......
......@@ -31,7 +31,7 @@ Feature: Covers all positive and negative test cases around WKS transformation s
| payload |
| "/input_payloads/payload_with_invalid_source.json" |
@WksService
@WksService1
Scenario Outline: Wks record to be created on raw record creation. WKS record should be updated on corresponding raw record update.
When I hit Storage service put end point with <payload>
Then Transformed record should be created in storage
......@@ -161,7 +161,7 @@ Feature: Covers all positive and negative test cases around WKS transformation s
Examples:
| relatedEntityPayload | parentPayload | expectedRelationshipBlock |
#| "/input_payloads/relationship/raw_having_wks_created_ihs_well_entity.json" | "/input_payloads/relationship/recordRelatedToEntityHavingWksCreatedIHSWellEntity.json" | "/input_payloads/relationship/expectedRelationship_for_rawHavingWksCreated.json" |
| "/input_payloads/relationship/raw_having_wks_created_ihs_well_entity.json" | "/input_payloads/relationship/recordRelatedToEntityHavingWksCreatedIHSWellEntity.json" | "/input_payloads/relationship/expectedRelationship_for_rawHavingWksCreated.json" |
@RelationshipValidation @Bug_690346
Scenario Outline: WKS record relationships block should show relation to wks record created by wks service, with mapping definition targeted to schema of non matching authority and entity
......@@ -174,10 +174,10 @@ Feature: Covers all positive and negative test cases around WKS transformation s
| relatedEntityPayload | parentPayload | expectedRelationshipBlock |
#| "/input_payloads/relationship/raw_having_wks_created_ihs_wellbore_entity.json" | "/input_payloads/relationship/recordRelatedToEntityHavingWksCreatedIHSWellboreEntity.json" | "/input_payloads/relationship/expectedRelationship_for_rawHavingWksCreated.json" |
@Yet_To_Be_Run
@RelationshipValidation
Scenario Outline: Multiple WKS record relationships block should show relation to wks record created by wks service, with mapping definition targeted to schema of same authority
Given I hit Storage service put end point with <relatedEntityPayload> to persist two records say raw1 and raw2
And I verify that multiple wks records are created for each of the above raw records having same autority and different entities
And I verify that multiple wks records are created for each of the above raw records having same autority
When I hit wks service with <parentPayload> whose raw record contains relationship to above records
Then Transformed record should contain relationship to multiple wks records with same authority of raw1 and raw2 <relatedEntityPayload> as per <expectedRelationshipBlock>
......@@ -185,14 +185,14 @@ Feature: Covers all positive and negative test cases around WKS transformation s
| relatedEntityPayload | parentPayload | expectedRelationshipBlock |
| "/input_payloads/relationship/multiple_raw_having_diffKindSameAuthority_wks_created.json" | "/input_payloads/relationship/recordRelatedToSameAuthorityHavingMultipleWKSCreated.json" | "/input_payloads/relationship/expectedRelationship_for_multipleRelatedRawWithWksCreated.json" |
@Yet_To_Be_Run
@RelationshipValidation
Scenario Outline: Multiple WKS record relationships block should show relation to wks record created by wks service, with mapping definition targeted to schema of same authority and same entity
Given I hit Storage service put end point with <relatedEntityPayload> to persist two records say raw1 and raw2
And I verify that multiple wks records are created for each of the above raw records having same autority and different entities
When I hit wks service with <parentPayload> whose raw record contains relationship to above records
Then Transformed record should contain relationship to multiple wks records with same entity of raw1 and raw2 <relatedEntityPayload> as per <expectedRelationshipBlock>
Examples:
Examples: vc
| relatedEntityPayload | parentPayload | expectedRelationshipBlock |
| "/input_payloads/relationship/multiple_raw_having_diffKindSameEntity_wks_created.json" | "/input_payloads/relationship/recordRelatedToSameEntitiesHavingMultipleWKSCreated.json" | "/input_payloads/relationship/expectedRelationship_for_multipleRelatedRawWithWksCreated.json" |
......
......@@ -4,8 +4,8 @@
"Spud date": "atspud",
"UWI": "rawHavingWksCreated"
},
"id": "<tenant_name>:well:record1ForMultipleRelatedEntityCheck1",
"kind": "<tenant_name>:at:well:1.0.0",
"id": "<tenant_name>:wellset1:record1ForMultipleRelatedEntityCheck1",
"kind": "<tenant_name>:petrel:wellset1:1.0.0",
"acl": {
"viewers": [
"<acl_viewers>@<tenant_name>.<cloud_domain>"
......@@ -30,8 +30,8 @@
"Spud date": "atspud",
"UWI": "rawHavingWksCreated"
},
"id": "<tenant_name>:log:record2ForMultipleRelatedEntityCheck1",
"kind": "<tenant_name>:oga:log:1.0.0",
"id": "<tenant_name>:logset1:record2ForMultipleRelatedEntityCheck1",
"kind": "<tenant_name>:at:logset1:1.0.0",
"acl": {
"viewers": [
"<acl_viewers>@<tenant_name>.<cloud_domain>"
......
......@@ -4,8 +4,8 @@
"Spud date": "atspud",
"UWI": "rawHavingWksCreated"
},
"id": "<tenant_name>:well:record1ForMultipleRelatedEntityCheck1",
"kind": "<tenant_name>:at:well:1.0.0",
"id": "<tenant_name>:wellset:record1ForMultipleRelatedEntityCheck1",
"kind": "<tenant_name>:petrel:wellset:1.0.0",
"acl": {
"viewers": [
"<acl_viewers>@<tenant_name>.<cloud_domain>"
......@@ -30,8 +30,8 @@
"Spud date": "atspud",
"UWI": "rawHavingWksCreated"
},
"id": "<tenant_name>:log:record2ForMultipleRelatedEntityCheck1",
"kind": "<tenant_name>:oga:log:1.0.0",
"id": "<tenant_name>:logset:record2ForMultipleRelatedEntityCheck1",
"kind": "<tenant_name>:at:logset:1.0.0",
"acl": {
"viewers": [
"<acl_viewers>@<tenant_name>.<cloud_domain>"
......
......@@ -4,8 +4,8 @@
"relationships": {
"wellbores": {
"ids": [
"<tenant_name>:well:record1ForMultipleRelatedEntityCheck1",
"<tenant_name>:log:record2ForMultipleRelatedEntityCheck1"
"<tenant_name>:wellset1:record1ForMultipleRelatedEntityCheck1",
"<tenant_name>:logset1:record2ForMultipleRelatedEntityCheck1"
],
"names": [
"record1ForMultipleRelatedEntityCheck",
......@@ -18,7 +18,7 @@
}
}
},
"id": "opendes:wellbore:manuallyTestingmultiplemappingsDay6",
"id": "<CreateUniqueID>",
"kind": "opendes:at:wellbore:1.0.0",
"acl": {
"viewers": [
......
......@@ -4,8 +4,8 @@
"relationships": {
"wellbores": {
"ids": [
"<tenant_name>:well:record1ForMultipleRelatedEntityCheck1",
"<tenant_name>:log:record2ForMultipleRelatedEntityCheck1"
"<tenant_name>:wellset:record1ForMultipleRelatedEntityCheck1",
"<tenant_name>:logset:record2ForMultipleRelatedEntityCheck1"
],
"names": [
"record1ForMultipleRelatedEntityCheck",
......@@ -18,8 +18,8 @@
}
}
},
"id": "opendes:wellbore:manuallyTestingmultiplemappingsDay9",
"kind": "opendes:at:wellbore:1.0.0",
"id": "<CreateUniqueID>",
"kind": "<tenant_name>:at:wellbore:1.0.0",
"acl": {
"viewers": [
"<acl_viewers>@<tenant_name>.<cloud_domain>"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment