Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
Data Flow
Data Enrichment
wks
Commits
a180ead4
Commit
a180ead4
authored
Feb 03, 2021
by
harshit aggarwal
Browse files
Fixing broken ITs
parent
308ff5c7
Pipeline
#24615
failed with stages
in 2 minutes and 24 seconds
Changes
21
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
testing/wks-test-core/src/test/java/org/opengroup/osdu/wks/stepdefs/IntegrationTestStepDefs.java
View file @
a180ead4
...
...
@@ -639,7 +639,7 @@ public class IntegrationTestStepDefs implements En {
targetSchemaKindInMapping
=
targetSchemaKindInMapping
.
replace
(
AutomationConstants
.
COLON_SEPARATOR
,
AutomationConstants
.
POINT
);
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
;
}
...
...
@@ -739,14 +739,20 @@ public class IntegrationTestStepDefs implements En {
private
String
generateRandomId
(
String
body
)
{
String
rawRecordKind
=
extractKind
(
body
).
replace
(
"["
,
""
).
replace
(
"]"
,
""
);
String
idPrefix
=
rawRecordKind
.
substring
(
0
,
rawRecordKind
.
lastIndexOf
(
":"
));
String
rawRecordId
=
idPrefix
+
"-integrationTestData"
+
RandomStringUtils
.
randomAlphabetic
(
15
);
LOGGER
.
log
(
Level
.
INFO
,
"Current Record : "
+
rawRecordId
);
return
rawRecordId
;
return
generateRawRecordId
(
rawRecordKind
);
}
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
);
LOGGER
.
log
(
Level
.
INFO
,
"Current Record : "
+
rawRecordId
);
return
rawRecordId
;
...
...
testing/wks-test-core/src/test/java/org/opengroup/osdu/wks/util/KindsUtil.java
View file @
a180ead4
package
org.opengroup.osdu.wks.util
;
import
org.opengroup.osdu.wks.constants.Constants
;
import
org.opengroup.osdu.wks.constants.SchemaConstants
;
import
java.util.stream.Stream
;
...
...
@@ -21,4 +22,25 @@ public class KindsUtil {
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
];
}
}
testing/wks-test-core/src/test/resources/input_payloads/relationship/expectedRelationship_for_multipleWksRecordVersions.json
View file @
a180ead4
{
"wellbore"
:
{
"id"
:
"<tenant_name>:
wks:
wellbore-b3BlbmRlczphdDp3ZWxsYm9yZS1NdWx0aXBsZVJlY29yZFZlcnNpb24"
"id"
:
"<tenant_name>:wellbore
:wks
-b3BlbmRlczphdDp3ZWxsYm9yZS1NdWx0aXBsZVJlY29yZFZlcnNpb24"
}
}
testing/wks-test-core/src/test/resources/input_payloads/relationship/multiple_raw_having_wks_created.json
View file @
a180ead4
...
...
@@ -4,7 +4,7 @@
"Spud date"
:
"atspud"
,
"UWI"
:
"rawHavingWksCreated"
},
"id"
:
"<tenant_name>:
at:
wellbore-record1ForMultipleRelatedEntityCheck"
,
"id"
:
"<tenant_name>:wellbore
:at
-record1ForMultipleRelatedEntityCheck"
,
"kind"
:
"<tenant_name>:at:wellbore:1.0.0"
,
"acl"
:
{
"viewers"
:
[
...
...
@@ -30,7 +30,7 @@
"Spud date"
:
"atspud"
,
"UWI"
:
"rawHavingWksCreated"
},
"id"
:
"<tenant_name>:
at:
wellbore-record2ForMultipleRelatedEntityCheck"
,
"id"
:
"<tenant_name>:wellbore
:at
-record2ForMultipleRelatedEntityCheck"
,
"kind"
:
"<tenant_name>:at:wellbore:1.0.0"
,
"acl"
:
{
"viewers"
:
[
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/multiple_wks_major_versions.json
View file @
a180ead4
...
...
@@ -3,7 +3,7 @@
"data"
:
{
"UWI"
:
"wksWithLowerMajorVersion"
},
"id"
:
"<tenant_name>:
wks:
wksMapping-lowerMajorVersion"
,
"id"
:
"<tenant_name>:wksMapping
:wks
-lowerMajorVersion"
,
"kind"
:
"<tenant_name>:wks:wksMapping:1.0.0"
,
"acl"
:
{
"viewers"
:
[
...
...
@@ -24,7 +24,7 @@
},
"ancestry"
:
{
"parents"
:
[
"<tenant_name>:
no:
wksMapping-rawHavingMultipleWksCreated:<rawRecordLatestVersion>"
"<tenant_name>:wksMapping
:no
-rawHavingMultipleWksCreated:<rawRecordLatestVersion>"
]
}
},
...
...
@@ -32,7 +32,7 @@
"data"
:
{
"UWI"
:
"wksWithHigherMajorVersion"
},
"id"
:
"<tenant_name>:
wks:
wksMapping-higherMajorVersion"
,
"id"
:
"<tenant_name>:wksMapping
:wks
-higherMajorVersion"
,
"kind"
:
"<tenant_name>:wks:wksMapping:2.0.0"
,
"acl"
:
{
"viewers"
:
[
...
...
@@ -53,7 +53,7 @@
},
"ancestry"
:
{
"parents"
:
[
"<tenant_name>:
no:
wksMapping-rawHavingMultipleWksCreated:<rawRecordLatestVersion>"
"<tenant_name>:wksMapping
:no
-rawHavingMultipleWksCreated:<rawRecordLatestVersion>"
]
}
}
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/raw_for_wks_record_version1.json
View file @
a180ead4
...
...
@@ -4,7 +4,7 @@
"Spud date"
:
"atspud"
,
"UWI"
:
"version1"
},
"id"
:
"<tenant_name>:
at:
wellbore-MultipleRecordVersion"
,
"id"
:
"<tenant_name>:wellbore
:at
-MultipleRecordVersion"
,
"kind"
:
"<tenant_name>:at:wellbore:1.0.0"
,
"acl"
:
{
"viewers"
:
[
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/raw_for_wks_record_version2.json
View file @
a180ead4
...
...
@@ -4,7 +4,7 @@
"Spud date"
:
"atspud"
,
"UWI"
:
"version2"
},
"id"
:
"<tenant_name>:
at:
wellbore-MultipleRecordVersion"
,
"id"
:
"<tenant_name>:wellbore
:at
-MultipleRecordVersion"
,
"kind"
:
"<tenant_name>:at:wellbore:1.0.0"
,
"acl"
:
{
"viewers"
:
[
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/raw_having_multiple_wks_major_versions.json
View file @
a180ead4
...
...
@@ -4,7 +4,7 @@
"Spud date"
:
"atspud"
,
"UWI"
:
"rawHavingWksCreated"
},
"id"
:
"<tenant_name>:
no:
wksMapping-rawHavingMultipleWksCreated"
,
"id"
:
"<tenant_name>:wksMapping
:no
-rawHavingMultipleWksCreated"
,
"kind"
:
"<tenant_name>:no:wksMapping:1.0.0"
,
"acl"
:
{
"viewers"
:
[
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/raw_having_no_wks_mapping.json
View file @
a180ead4
...
...
@@ -4,7 +4,7 @@
"Spud date"
:
"atspud"
,
"UWI"
:
"rawHavingWksCreated"
},
"id"
:
"<tenant_name>:
no:
wksMapping-rawHavingNoWksCreated"
,
"id"
:
"<tenant_name>:wksMapping
:no
-rawHavingNoWksCreated"
,
"kind"
:
"<tenant_name>:no:wksMapping:1.0.0"
,
"acl"
:
{
"viewers"
:
[
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/raw_having_wks_created.json
View file @
a180ead4
...
...
@@ -4,7 +4,7 @@
"Spud date"
:
"atspud"
,
"UWI"
:
"rawHavingWksCreated"
},
"id"
:
"<tenant_name>:
at:
wellbore-rawHavingWksCreated"
,
"id"
:
"<tenant_name>:wellbore
:at
-rawHavingWksCreated"
,
"kind"
:
"<tenant_name>:at:wellbore:1.0.0"
,
"acl"
:
{
"viewers"
:
[
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/raw_having_wks_created_log_entity.json
View file @
a180ead4
...
...
@@ -4,7 +4,7 @@
"Spud date"
:
"atspud"
,
"UWI"
:
"rawHavingWksCreated"
},
"id"
:
"<tenant_name>:
ihs:log
-rawHavingWksCreated"
,
"id"
:
"<tenant_name>:
log:ihs
-rawHavingWksCreated"
,
"kind"
:
"<tenant_name>:ihs:log:1.0.0"
,
"acl"
:
{
"viewers"
:
[
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/raw_having_wks_created_well_entity.json
View file @
a180ead4
...
...
@@ -4,7 +4,7 @@
"Spud date"
:
"atspud"
,
"UWI"
:
"rawHavingWksCreated"
},
"id"
:
"<tenant_name>:
oga:
well-rawHavingWksCreated"
,
"id"
:
"<tenant_name>:well
-oga
-rawHavingWksCreated"
,
"kind"
:
"<tenant_name>:oga:well:1.0.0"
,
"acl"
:
{
"viewers"
:
[
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/recordRelatedToAnotherRawButNotCreatedByWKSService.json
View file @
a180ead4
...
...
@@ -5,7 +5,7 @@
"id"
:
"<CreateUniqueID>"
,
"ancestry"
:
{
"parents"
:
[
"<tenant_name>:
oga:
well-rawHavingWksCreated"
"<tenant_name>:well
:oga
-rawHavingWksCreated"
]
},
"kind"
:
"<tenant_name>:no:wksMapping:1.0.0"
,
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/recordRelatedToAnotherRawWithMultipleWks.json
View file @
a180ead4
...
...
@@ -3,7 +3,7 @@
"data"
:
{
"relationships"
:
{
"wellbore"
:
{
"id"
:
"<tenant_name>:
no:
wksMapping-rawHavingMultipleWksCreated"
"id"
:
"<tenant_name>:wksMapping
:no
-rawHavingMultipleWksCreated"
}
}
},
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/recordRelatedToAnotherRawWithMultipleWksRecordVersions.json
View file @
a180ead4
...
...
@@ -3,7 +3,7 @@
"data"
:
{
"relationships"
:
{
"wellbore"
:
{
"id"
:
"<tenant_name>:
at:
wellbore-MultipleRecordVersion"
"id"
:
"<tenant_name>:wellbore
:at
-MultipleRecordVersion"
}
}
},
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/recordRelatedToAnotherRecordWithNoWKS.json
View file @
a180ead4
...
...
@@ -3,7 +3,7 @@
"data"
:
{
"relationships"
:
{
"wellbore"
:
{
"id"
:
"<tenant_name>:
no:
wksMapping-rawHavingNoWksCreated"
"id"
:
"<tenant_name>:wksMapping
:no
-rawHavingNoWksCreated"
}
}
},
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/recordRelatedToEntityHavingWksCreated.json
View file @
a180ead4
...
...
@@ -3,7 +3,7 @@
"data"
:
{
"relationships"
:
{
"wellbore"
:
{
"id"
:
"<tenant_name>:
at:
wellbore-rawHavingWksCreated"
"id"
:
"<tenant_name>:wellbore
:at
-rawHavingWksCreated"
}
}
},
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/recordRelatedToEntityHavingWksCreatedLogEntity.json
View file @
a180ead4
...
...
@@ -3,7 +3,7 @@
"data"
:
{
"relationships"
:
{
"wellbore"
:
{
"id"
:
"<tenant_name>:
ihs:log
-rawHavingWksCreated"
"id"
:
"<tenant_name>:
log:ihs
-rawHavingWksCreated"
}
}
},
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/recordRelatedToEntityHavingWksCreatedWellEntity.json
View file @
a180ead4
...
...
@@ -3,7 +3,7 @@
"data"
:
{
"relationships"
:
{
"wellbore"
:
{
"id"
:
"<tenant_name>:
oga:
well-rawHavingWksCreated"
"id"
:
"<tenant_name>:well
:oga
-rawHavingWksCreated"
}
}
},
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/recordRelatedToMultipleEntitiesHavingWKSCreated.json
View file @
a180ead4
...
...
@@ -4,8 +4,8 @@
"relationships"
:
{
"wellbores"
:
{
"ids"
:
[
"<tenant_name>:
at:
wellbore-record1ForMultipleRelatedEntityCheck"
,
"<tenant_name>:
at:
wellbore-record2ForMultipleRelatedEntityCheck"
"<tenant_name>:wellbore
:at
-record1ForMultipleRelatedEntityCheck"
,
"<tenant_name>:wellbore
:at
-record2ForMultipleRelatedEntityCheck"
],
"names"
:
[
"record1ForMultipleRelatedEntityCheck"
,
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment