Commit 8cfb4782 authored by harshit aggarwal's avatar harshit aggarwal
Browse files

Merge branch 'master' into haaggarw/PerfTestingConfig

parents b9e1a4a5 85c15576
Pipeline #24996 failed with stages
in 2 minutes and 23 seconds
...@@ -639,7 +639,7 @@ public class IntegrationTestStepDefs implements En { ...@@ -639,7 +639,7 @@ public class IntegrationTestStepDefs implements En {
targetSchemaKindInMapping = targetSchemaKindInMapping.replace(AutomationConstants.COLON_SEPARATOR, AutomationConstants.POINT); targetSchemaKindInMapping = targetSchemaKindInMapping.replace(AutomationConstants.COLON_SEPARATOR, AutomationConstants.POINT);
String[] kindStrArr = targetSchemaKind.split(AutomationConstants.COLON_SEPARATOR); String[] kindStrArr = targetSchemaKind.split(AutomationConstants.COLON_SEPARATOR);
return idStrArr[0] + AutomationConstants.COLON_SEPARATOR + AutomationConstants.WKS_KIND + AutomationConstants.COLON_SEPARATOR + kindStrArr[2] return idStrArr[0] + AutomationConstants.COLON_SEPARATOR + kindStrArr[2] + AutomationConstants.COLON_SEPARATOR + AutomationConstants.WKS_KIND
+ AutomationConstants.DASH + uniqueId + AutomationConstants.POINT + targetSchemaKindInMapping; + AutomationConstants.DASH + uniqueId + AutomationConstants.POINT + targetSchemaKindInMapping;
} }
...@@ -739,14 +739,20 @@ public class IntegrationTestStepDefs implements En { ...@@ -739,14 +739,20 @@ public class IntegrationTestStepDefs implements En {
private String generateRandomId(String body) { private String generateRandomId(String body) {
String rawRecordKind = extractKind(body).replace("[", "").replace("]", ""); String rawRecordKind = extractKind(body).replace("[", "").replace("]", "");
String idPrefix = rawRecordKind.substring(0, rawRecordKind.lastIndexOf(":")); return generateRawRecordId(rawRecordKind);
String rawRecordId = idPrefix + "-integrationTestData" + RandomStringUtils.randomAlphabetic(15);
LOGGER.log(Level.INFO, "Current Record : " + rawRecordId);
return rawRecordId;
} }
private String generateRawRecordId(String os_wks_kind) { private String generateRawRecordId(String os_wks_kind) {
String idPrefix = os_wks_kind.substring(0, os_wks_kind.lastIndexOf(":")); KindsUtil kindsUtil = new KindsUtil();
String authority = kindsUtil.retrieveAuthorityName(os_wks_kind);
String entityType = kindsUtil.retrieveEntityName(os_wks_kind);
String source = kindsUtil.retrieveSourceName(os_wks_kind);
String idPrefix = authority.concat(AutomationConstants.COLON_SEPARATOR)
.concat(entityType)
.concat(AutomationConstants.COLON_SEPARATOR)
.concat(source);
String rawRecordId = idPrefix + "-integrationTestData" + RandomStringUtils.randomAlphabetic(15); String rawRecordId = idPrefix + "-integrationTestData" + RandomStringUtils.randomAlphabetic(15);
LOGGER.log(Level.INFO, "Current Record : " + rawRecordId); LOGGER.log(Level.INFO, "Current Record : " + rawRecordId);
return rawRecordId; return rawRecordId;
......
package org.opengroup.osdu.wks.util; package org.opengroup.osdu.wks.util;
import org.opengroup.osdu.wks.constants.Constants; import org.opengroup.osdu.wks.constants.Constants;
import org.opengroup.osdu.wks.constants.SchemaConstants;
import java.util.stream.Stream; import java.util.stream.Stream;
...@@ -21,4 +22,25 @@ public class KindsUtil { ...@@ -21,4 +22,25 @@ public class KindsUtil {
return String.join(Constants.POINT, kindUptoMajorVersion, minorVersion, patchVersion); return String.join(Constants.POINT, kindUptoMajorVersion, minorVersion, patchVersion);
} }
public String retrieveAuthorityName(String kind) {
String[] idArr = kind.split(Constants.COLON_SEPARATOR);
return idArr[SchemaConstants.AUTHORITY_INDEX];
}
public String retrieveEntityName(String id) {
String[] idArr = id.split(Constants.COLON_SEPARATOR);
return idArr[SchemaConstants.ENTITY_INDEX];
}
public String retrieveSourceName(String id) {
String[] idArr = id.split(Constants.COLON_SEPARATOR);
return idArr[SchemaConstants.SOURCE_INDEX];
}
public String retrieveMajorVersion(String kind) {
String[] idArr = kind.split(Constants.COLON_SEPARATOR);
String version = idArr[SchemaConstants.VERSION_INDEX];
return version.split("\\.")[0];
}
} }
{ {
"wellbore": { "wellbore": {
"id": "<tenant_name>:wks:wellbore-b3BlbmRlczphdDp3ZWxsYm9yZS1NdWx0aXBsZVJlY29yZFZlcnNpb24" "id": "<tenant_name>:wellbore:wks-b3BlbmRlczphdDp3ZWxsYm9yZS1NdWx0aXBsZVJlY29yZFZlcnNpb24"
} }
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Spud date": "atspud", "Spud date": "atspud",
"UWI": "rawHavingWksCreated" "UWI": "rawHavingWksCreated"
}, },
"id": "<tenant_name>:at:wellbore-record1ForMultipleRelatedEntityCheck", "id": "<tenant_name>:wellbore:at-record1ForMultipleRelatedEntityCheck",
"kind": "<tenant_name>:at:wellbore:1.0.0", "kind": "<tenant_name>:at:wellbore:1.0.0",
"acl": { "acl": {
"viewers": [ "viewers": [
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
"Spud date": "atspud", "Spud date": "atspud",
"UWI": "rawHavingWksCreated" "UWI": "rawHavingWksCreated"
}, },
"id": "<tenant_name>:at:wellbore-record2ForMultipleRelatedEntityCheck", "id": "<tenant_name>:wellbore:at-record2ForMultipleRelatedEntityCheck",
"kind": "<tenant_name>:at:wellbore:1.0.0", "kind": "<tenant_name>:at:wellbore:1.0.0",
"acl": { "acl": {
"viewers": [ "viewers": [
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"data": { "data": {
"UWI": "wksWithLowerMajorVersion" "UWI": "wksWithLowerMajorVersion"
}, },
"id": "<tenant_name>:wks:wksMapping-lowerMajorVersion", "id": "<tenant_name>:wksMapping:wks-lowerMajorVersion",
"kind": "<tenant_name>:wks:wksMapping:1.0.0", "kind": "<tenant_name>:wks:wksMapping:1.0.0",
"acl": { "acl": {
"viewers": [ "viewers": [
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
}, },
"ancestry": { "ancestry": {
"parents": [ "parents": [
"<tenant_name>:no:wksMapping-rawHavingMultipleWksCreated:<rawRecordLatestVersion>" "<tenant_name>:wksMapping:no-rawHavingMultipleWksCreated:<rawRecordLatestVersion>"
] ]
} }
}, },
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"data": { "data": {
"UWI": "wksWithHigherMajorVersion" "UWI": "wksWithHigherMajorVersion"
}, },
"id": "<tenant_name>:wks:wksMapping-higherMajorVersion", "id": "<tenant_name>:wksMapping:wks-higherMajorVersion",
"kind": "<tenant_name>:wks:wksMapping:2.0.0", "kind": "<tenant_name>:wks:wksMapping:2.0.0",
"acl": { "acl": {
"viewers": [ "viewers": [
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
}, },
"ancestry": { "ancestry": {
"parents": [ "parents": [
"<tenant_name>:no:wksMapping-rawHavingMultipleWksCreated:<rawRecordLatestVersion>" "<tenant_name>:wksMapping:no-rawHavingMultipleWksCreated:<rawRecordLatestVersion>"
] ]
} }
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Spud date": "atspud", "Spud date": "atspud",
"UWI": "version1" "UWI": "version1"
}, },
"id": "<tenant_name>:at:wellbore-MultipleRecordVersion", "id": "<tenant_name>:wellbore:at-MultipleRecordVersion",
"kind": "<tenant_name>:at:wellbore:1.0.0", "kind": "<tenant_name>:at:wellbore:1.0.0",
"acl": { "acl": {
"viewers": [ "viewers": [
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Spud date": "atspud", "Spud date": "atspud",
"UWI": "version2" "UWI": "version2"
}, },
"id": "<tenant_name>:at:wellbore-MultipleRecordVersion", "id": "<tenant_name>:wellbore:at-MultipleRecordVersion",
"kind": "<tenant_name>:at:wellbore:1.0.0", "kind": "<tenant_name>:at:wellbore:1.0.0",
"acl": { "acl": {
"viewers": [ "viewers": [
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Spud date": "atspud", "Spud date": "atspud",
"UWI": "rawHavingWksCreated" "UWI": "rawHavingWksCreated"
}, },
"id": "<tenant_name>:no:wksMapping-rawHavingMultipleWksCreated", "id": "<tenant_name>:wksMapping:no-rawHavingMultipleWksCreated",
"kind": "<tenant_name>:no:wksMapping:1.0.0", "kind": "<tenant_name>:no:wksMapping:1.0.0",
"acl": { "acl": {
"viewers": [ "viewers": [
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Spud date": "atspud", "Spud date": "atspud",
"UWI": "rawHavingWksCreated" "UWI": "rawHavingWksCreated"
}, },
"id": "<tenant_name>:no:wksMapping-rawHavingNoWksCreated", "id": "<tenant_name>:wksMapping:no-rawHavingNoWksCreated",
"kind": "<tenant_name>:no:wksMapping:1.0.0", "kind": "<tenant_name>:no:wksMapping:1.0.0",
"acl": { "acl": {
"viewers": [ "viewers": [
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Spud date": "atspud", "Spud date": "atspud",
"UWI": "rawHavingWksCreated" "UWI": "rawHavingWksCreated"
}, },
"id": "<tenant_name>:at:wellbore-rawHavingWksCreated", "id": "<tenant_name>:wellbore:at-rawHavingWksCreated",
"kind": "<tenant_name>:at:wellbore:1.0.0", "kind": "<tenant_name>:at:wellbore:1.0.0",
"acl": { "acl": {
"viewers": [ "viewers": [
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Spud date": "atspud", "Spud date": "atspud",
"UWI": "rawHavingWksCreated" "UWI": "rawHavingWksCreated"
}, },
"id": "<tenant_name>:ihs:log-rawHavingWksCreated", "id": "<tenant_name>:log:ihs-rawHavingWksCreated",
"kind": "<tenant_name>:ihs:log:1.0.0", "kind": "<tenant_name>:ihs:log:1.0.0",
"acl": { "acl": {
"viewers": [ "viewers": [
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Spud date": "atspud", "Spud date": "atspud",
"UWI": "rawHavingWksCreated" "UWI": "rawHavingWksCreated"
}, },
"id": "<tenant_name>:oga:well-rawHavingWksCreated", "id": "<tenant_name>:well-oga-rawHavingWksCreated",
"kind": "<tenant_name>:oga:well:1.0.0", "kind": "<tenant_name>:oga:well:1.0.0",
"acl": { "acl": {
"viewers": [ "viewers": [
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"id": "<CreateUniqueID>", "id": "<CreateUniqueID>",
"ancestry": { "ancestry": {
"parents": [ "parents": [
"<tenant_name>:oga:well-rawHavingWksCreated" "<tenant_name>:well:oga-rawHavingWksCreated"
] ]
}, },
"kind": "<tenant_name>:no:wksMapping:1.0.0", "kind": "<tenant_name>:no:wksMapping:1.0.0",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"data": { "data": {
"relationships": { "relationships": {
"wellbore": { "wellbore": {
"id": "<tenant_name>:no:wksMapping-rawHavingMultipleWksCreated" "id": "<tenant_name>:wksMapping:no-rawHavingMultipleWksCreated"
} }
} }
}, },
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"data": { "data": {
"relationships": { "relationships": {
"wellbore": { "wellbore": {
"id": "<tenant_name>:at:wellbore-MultipleRecordVersion" "id": "<tenant_name>:wellbore:at-MultipleRecordVersion"
} }
} }
}, },
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"data": { "data": {
"relationships": { "relationships": {
"wellbore": { "wellbore": {
"id": "<tenant_name>:no:wksMapping-rawHavingNoWksCreated" "id": "<tenant_name>:wksMapping:no-rawHavingNoWksCreated"
} }
} }
}, },
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"data": { "data": {
"relationships": { "relationships": {
"wellbore": { "wellbore": {
"id": "<tenant_name>:at:wellbore-rawHavingWksCreated" "id": "<tenant_name>:wellbore:at-rawHavingWksCreated"
} }
} }
}, },
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"data": { "data": {
"relationships": { "relationships": {
"wellbore": { "wellbore": {
"id": "<tenant_name>:ihs:log-rawHavingWksCreated" "id": "<tenant_name>:log:ihs-rawHavingWksCreated"
} }
} }
}, },
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"data": { "data": {
"relationships": { "relationships": {
"wellbore": { "wellbore": {
"id": "<tenant_name>:oga:well-rawHavingWksCreated" "id": "<tenant_name>:well:oga-rawHavingWksCreated"
} }
} }
}, },
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
"relationships": { "relationships": {
"wellbores": { "wellbores": {
"ids": [ "ids": [
"<tenant_name>:at:wellbore-record1ForMultipleRelatedEntityCheck", "<tenant_name>:wellbore:at-record1ForMultipleRelatedEntityCheck",
"<tenant_name>:at:wellbore-record2ForMultipleRelatedEntityCheck" "<tenant_name>:wellbore:at-record2ForMultipleRelatedEntityCheck"
], ],
"names": [ "names": [
"record1ForMultipleRelatedEntityCheck", "record1ForMultipleRelatedEntityCheck",
......
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