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
85c15576
Commit
85c15576
authored
Feb 05, 2021
by
Hema Vishnu Pola [Microsoft]
Browse files
Merge branch 'azure/FixingBrokenIts' into 'master'
Fixing broken Integration Tests See merge request
!35
parents
308ff5c7
f6269db5
Pipeline
#26194
passed with stages
in 15 minutes and 4 seconds
Changes
30
Pipelines
6
Hide whitespace changes
Inline
Side-by-side
testing/wks-test-core/src/test/java/org/opengroup/osdu/wks/stepdefs/IntegrationTestStepDefs.java
View file @
85c15576
...
@@ -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
;
...
...
testing/wks-test-core/src/test/java/org/opengroup/osdu/wks/util/KindsUtil.java
View file @
85c15576
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
];
}
}
}
testing/wks-test-core/src/test/resources/input_payloads/relationship/expectedRelationship_for_multipleWksRecordVersions.json
View file @
85c15576
{
{
"wellbore"
:
{
"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 @
85c15576
...
@@ -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"
:
[
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/multiple_wks_major_versions.json
View file @
85c15576
...
@@ -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>"
]
]
}
}
}
}
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/raw_for_wks_record_version1.json
View file @
85c15576
...
@@ -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"
:
[
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/raw_for_wks_record_version2.json
View file @
85c15576
...
@@ -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"
:
[
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/raw_having_multiple_wks_major_versions.json
View file @
85c15576
...
@@ -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"
:
[
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/raw_having_no_wks_mapping.json
View file @
85c15576
...
@@ -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"
:
[
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/raw_having_wks_created.json
View file @
85c15576
...
@@ -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"
:
[
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/raw_having_wks_created_log_entity.json
View file @
85c15576
...
@@ -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"
:
[
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/raw_having_wks_created_well_entity.json
View file @
85c15576
...
@@ -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"
:
[
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/recordRelatedToAnotherRawButNotCreatedByWKSService.json
View file @
85c15576
...
@@ -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"
,
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/recordRelatedToAnotherRawWithMultipleWks.json
View file @
85c15576
...
@@ -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"
}
}
}
}
},
},
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/recordRelatedToAnotherRawWithMultipleWksRecordVersions.json
View file @
85c15576
...
@@ -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"
}
}
}
}
},
},
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/recordRelatedToAnotherRecordWithNoWKS.json
View file @
85c15576
...
@@ -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"
}
}
}
}
},
},
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/recordRelatedToEntityHavingWksCreated.json
View file @
85c15576
...
@@ -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"
}
}
}
}
},
},
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/recordRelatedToEntityHavingWksCreatedLogEntity.json
View file @
85c15576
...
@@ -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"
}
}
}
}
},
},
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/recordRelatedToEntityHavingWksCreatedWellEntity.json
View file @
85c15576
...
@@ -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"
}
}
}
}
},
},
...
...
testing/wks-test-core/src/test/resources/input_payloads/relationship/recordRelatedToMultipleEntitiesHavingWKSCreated.json
View file @
85c15576
...
@@ -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"
,
...
...
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