Commit 16601004 authored by devesh bajpai's avatar devesh bajpai
Browse files

Merge branch 'revert-wks-kind-fix' into 'master'

revert wks kind fix

See merge request !50
parents 20a5204f 6dd7daab
Pipeline #37308 passed with stages
in 40 minutes and 57 seconds
......@@ -25,7 +25,7 @@ public class AutomationConstants {
public static final String COLON_SEPARATOR = ":";
public static final String DASH = "-";
public static final String POINT = ".";
public static final String OS_TARGET_SCHEMA_KIND_TENANT = getEnvironmentVariableOrDefaultValue("OS_TARGET_SCHEMA_KIND_TENANT", "slb:wks:wellbore:1.4.0");
public static final String OS_TARGET_SCHEMA_KIND_TENANT = getEnvironmentVariableOrDefaultValue("OS_TARGET_SCHEMA_KIND_TENANT", "opendes:wks:wellbore:1.3.1");
public static final String OS_TARGET_SCHEMA_KIND = getEnvironmentVariableOrDefaultValue("OS_TARGET_SCHEMA_KIND", "slb:wks:wellbore:1.3.1");
public static final List<String> OS_TARGET_SCHEMA_KIND_IHS = Arrays.asList("slb:wks:log:2.3.1", "abc:wks:log:3.2.1");
public static final List<String> OS_TARGET_SCHEMA_KIND_OGA = Arrays.asList("slb:wks:well:4.3.1", "slb:wks:well:5.1.0", "abc:wks:well:1.5.1");
......
......@@ -226,6 +226,7 @@ public class IntegrationTestStepDefs implements En {
List<HttpResponse> httpResponseList = this.context.getResponseList();
for(int i=0; i<httpResponseList.size(); i++) {
String expectedKind = AutomationConstants.OS_TARGET_SCHEMA_KIND_IHS.get(i);
expectedKind = AutomationConstants.TENANT_NAME_PLACEHOLDER_VALUE + expectedKind.substring(expectedKind.indexOf(AutomationConstants.COLON_SEPARATOR));
String actualKind = new JsonPath(httpResponseList.get(i).getBody()).get("kind").toString();
assertEquals(expectedKind, actualKind);
}
......
......@@ -97,7 +97,7 @@ public class WksTransformer {
Tree transformedTree = copyTagsAttribute(rawRecordTree,transformedTreeFromPreviousStage);
transformedTree.putObject(ID, createRecordId(rawRecordTree, targetSchemaKind));
transformedTree.putObject(ANCESTRY + Constants.POINT + PARENTS, fetchParent(rawRecordTree));
transformedTree.putObject(KIND, targetSchemaKind);
transformedTree.putObject(KIND, createWksKind(targetSchemaKind, rawRecordTree.get(ID).asString()));
transformedTree.putObject(ACL, rawRecordTree.get(ACL));
transformedTree.putObject(LEGAL, rawRecordTree.get(LEGAL));
......@@ -193,6 +193,11 @@ public class WksTransformer {
return WksIdGenerator.createRecordId(rawRecordTree.get(ID).asString(), wksSchemaKind);
}
private String createWksKind(String wksSchemaKind, String rawRecordId) {
String[] idStrArr = rawRecordId.split(Constants.COLON_SEPARATOR);
return idStrArr[0] + wksSchemaKind.substring(wksSchemaKind.indexOf(Constants.COLON_SEPARATOR));
}
private String[] fetchParent(Tree rawRecordTree) {
String parent = rawRecordTree.get(ID).asString() + Constants.COLON_SEPARATOR + Long.valueOf(rawRecordTree
.get(VERSION)
......
......@@ -56,7 +56,7 @@ public class WksTransformerTest {
private static final String UNIT_TEST_RESOURCES_FOLDER_PATH = "/unit_test_resources/";
private static final String MAPPING_FILE_NAME = "mapping.json";
private static final String RAW_RECORD_FILE_NAME = "raw_record.json";
private static final String TARGET_SCHEMA_KIND = "part2:wks:entity:1.0.0";
private static final String TARGET_SCHEMA_KIND = "part1:wks:entity:1.0.0";
private static final String RAW_RECORD_WITHOUT_META_FILE_NAME = "raw_record_without_meta.json";
private static final String RAW_RECORD_WITH_EMPTY_META_FILE_NAME = "raw_record_with_empty_meta.json";
private static final String RAW_RECORD_WITH_NO_ANCESTRY_FILE_NAME = "raw_record_with_no_ancestry.json";
......
......@@ -8,7 +8,7 @@
"schemaVersionMajor": 1
},
"targetSchema": {
"authority": "part2",
"authority": "part1",
"source": "wks",
"entityType": "entity",
"schemaVersionMajor": 1
......
......@@ -51,11 +51,11 @@
"persistableReference" : "{\"lateBoundCRS\":{\"wkt\":\"GEOGCS[\\\"GCS_European_1950\\\",DATUM[\\\"D_European_1950\\\",SPHEROID[\\\"International_1924\\\",6378388.0,297.0]],PRIMEM[\\\"Greenwich\\\",0.0],UNIT[\\\"Degree\\\",0.0174532925199433],AUTHORITY[\\\"EPSG\\\",4230]]\",\"ver\":\"PE_10_3_1\",\"name\":\"GCS_European_1950\",\"authCode\":{\"auth\":\"EPSG\",\"code\":\"4230\"},\"type\":\"LBC\"},\"singleCT\":{\"wkt\":\"GEOGTRAN[\\\"ED_1950_To_WGS_1984_23\\\",GEOGCS[\\\"GCS_European_1950\\\",DATUM[\\\"D_European_1950\\\",SPHEROID[\\\"International_1924\\\",6378388.0,297.0]],PRIMEM[\\\"Greenwich\\\",0.0],UNIT[\\\"Degree\\\",0.0174532925199433]],GEOGCS[\\\"GCS_WGS_1984\\\",DATUM[\\\"D_WGS_1984\\\",SPHEROID[\\\"WGS_1984\\\",6378137.0,298.257223563]],PRIMEM[\\\"Greenwich\\\",0.0],UNIT[\\\"Degree\\\",0.0174532925199433]],METHOD[\\\"Position_Vector\\\"],PARAMETER[\\\"X_Axis_Translation\\\",-116.641],PARAMETER[\\\"Y_Axis_Translation\\\",-56.931],PARAMETER[\\\"Z_Axis_Translation\\\",-110.559],PARAMETER[\\\"X_Axis_Rotation\\\",0.893],PARAMETER[\\\"Y_Axis_Rotation\\\",0.921],PARAMETER[\\\"Z_Axis_Rotation\\\",-0.917],PARAMETER[\\\"Scale_Difference\\\",-3.52],AUTHORITY[\\\"EPSG\\\",1612]]\",\"ver\":\"PE_10_3_1\",\"name\":\"ED_1950_To_WGS_1984_23\",\"authCode\":{\"auth\":\"EPSG\",\"code\":\"1612\"},\"type\":\"ST\"},\"ver\":\"PE_10_3_1\",\"name\":\"ED50 * EPSG-Nor N62 2001 [4230,1612]\",\"authCode\":{\"auth\":\"\",\"code\":\"4230023\"},\"type\":\"EBC\"}",
"propertyNames" : [ "wksAttribute2.y" ]
} ],
"id" : "part1:entity:wks-3b9edab584ccc863c1dec7f1f5cf89c70d312020.part2.wks.entity.1",
"id" : "part1:entity:wks-3b9edab584ccc863c1dec7f1f5cf89c70d312020.part1.wks.entity.1",
"ancestry" : {
"parents" : [ "part1:source:entity-uniqueId:39429347234" ]
},
"kind" : "part2:wks:entity:1.0.0",
"kind" : "part1:wks:entity:1.0.0",
"acl" : {
"viewers" : [ "data.default.viewers@part1.dev.com" ],
"owners" : [ "data.default.owners@part1.dev.com" ]
......
......@@ -51,11 +51,11 @@
"persistableReference" : "{\"lateBoundCRS\":{\"wkt\":\"GEOGCS[\\\"GCS_European_1950\\\",DATUM[\\\"D_European_1950\\\",SPHEROID[\\\"International_1924\\\",6378388.0,297.0]],PRIMEM[\\\"Greenwich\\\",0.0],UNIT[\\\"Degree\\\",0.0174532925199433],AUTHORITY[\\\"EPSG\\\",4230]]\",\"ver\":\"PE_10_3_1\",\"name\":\"GCS_European_1950\",\"authCode\":{\"auth\":\"EPSG\",\"code\":\"4230\"},\"type\":\"LBC\"},\"singleCT\":{\"wkt\":\"GEOGTRAN[\\\"ED_1950_To_WGS_1984_23\\\",GEOGCS[\\\"GCS_European_1950\\\",DATUM[\\\"D_European_1950\\\",SPHEROID[\\\"International_1924\\\",6378388.0,297.0]],PRIMEM[\\\"Greenwich\\\",0.0],UNIT[\\\"Degree\\\",0.0174532925199433]],GEOGCS[\\\"GCS_WGS_1984\\\",DATUM[\\\"D_WGS_1984\\\",SPHEROID[\\\"WGS_1984\\\",6378137.0,298.257223563]],PRIMEM[\\\"Greenwich\\\",0.0],UNIT[\\\"Degree\\\",0.0174532925199433]],METHOD[\\\"Position_Vector\\\"],PARAMETER[\\\"X_Axis_Translation\\\",-116.641],PARAMETER[\\\"Y_Axis_Translation\\\",-56.931],PARAMETER[\\\"Z_Axis_Translation\\\",-110.559],PARAMETER[\\\"X_Axis_Rotation\\\",0.893],PARAMETER[\\\"Y_Axis_Rotation\\\",0.921],PARAMETER[\\\"Z_Axis_Rotation\\\",-0.917],PARAMETER[\\\"Scale_Difference\\\",-3.52],AUTHORITY[\\\"EPSG\\\",1612]]\",\"ver\":\"PE_10_3_1\",\"name\":\"ED_1950_To_WGS_1984_23\",\"authCode\":{\"auth\":\"EPSG\",\"code\":\"1612\"},\"type\":\"ST\"},\"ver\":\"PE_10_3_1\",\"name\":\"ED50 * EPSG-Nor N62 2001 [4230,1612]\",\"authCode\":{\"auth\":\"\",\"code\":\"4230023\"},\"type\":\"EBC\"}",
"propertyNames" : [ "wksAttribute2.y" ]
} ],
"id": "part1:entity:wks-3b9edab584ccc863c1dec7f1f5cf89c70d312020.part2.wks.entity.1",
"id": "part1:entity:wks-3b9edab584ccc863c1dec7f1f5cf89c70d312020.part1.wks.entity.1",
"ancestry" : {
"parents" : [ "part1:source:entity-uniqueId:39429347234" ]
},
"kind" : "part2:wks:entity:1.0.0",
"kind" : "part1:wks:entity:1.0.0",
"acl" : {
"viewers" : [ "data.default.viewers@part1.dev.com" ],
"owners" : [ "data.default.owners@part1.dev.com" ]
......
......@@ -35,11 +35,11 @@
},
"Wks Attribute 18 (CDE)" : 2246.5
},
"id" : "part1:entity:wks-3b9edab584ccc863c1dec7f1f5cf89c70d312020.part2.wks.entity.1",
"id" : "part1:entity:wks-3b9edab584ccc863c1dec7f1f5cf89c70d312020.part1.wks.entity.1",
"ancestry" : {
"parents" : [ "part1:source:entity-uniqueId:39429347234" ]
},
"kind" : "part2:wks:entity:1.0.0",
"kind" : "part1:wks:entity:1.0.0",
"acl" : {
"viewers" : [ "data.default.viewers@part1.dev.com" ],
"owners" : [ "data.default.owners@part1.dev.com" ]
......
{
"id" : "part1:entity:wks-066f2079ed2f81f02a550b91140d4d7d68b1adf0.part2.wks.entity.1",
"id" : "part1:entity:wks-066f2079ed2f81f02a550b91140d4d7d68b1adf0.part1.wks.entity.1",
"ancestry" : {
"parents" : [ "part1:source:wellbore-dGVzdFdlbGxfYXV0b19hdHRlbXB0Ng:1568075751408965" ]
},
"kind" : "part2:wks:entity:1.0.0",
"kind" : "part1:wks:entity:1.0.0",
"acl" : {
"viewers" : [ "data.default.viewers@part1.dev.com" ],
"owners" : [ "data.default.owners@part1.dev.com" ]
......
Markdown is supported
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