Commit d1034e53 authored by Paresh Behede's avatar Paresh Behede
Browse files

Merge branch 'RefactorTestSuite' into 'master'

Test suite refactor

See merge request !76
parents 1316e866 9e1450b6
Pipeline #46839 passed with stages
in 36 minutes and 59 seconds
......@@ -15,8 +15,7 @@ import org.opengroup.osdu.wks.util.AuthUtil;
@ScenarioScoped
public class WksIntegrationTestScope {
@Inject
private FileUtils fileUtils;
private FileUtils fileUtils = new FileUtils();
private String token;
private String inputPayload;
......
package org.opengroup.osdu.wks.stepdefs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.lang3.RandomStringUtils;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.opengroup.osdu.de.automation.model.HttpResponse;
import org.opengroup.osdu.wks.model.AutomationConstants;
import org.opengroup.osdu.wks.model.WksIntegrationTestScope;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import io.cucumber.java8.En;
import io.restassured.path.json.JsonPath;
public class HappyFlowStepDefs implements En {
public final static Logger LOGGER = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
CommonMethods commonMethods = new CommonMethods();
public WksIntegrationTestScope context = commonMethods.getContext();
public HappyFlowStepDefs() {
Given("I hit Storage service put end point with {string}", (String inputPayload) -> {
String payload = context.getFileUtils().read(inputPayload);
payload = commonMethods.updatePlaceholdersInInputPayload(payload);
String recordId = commonMethods.generateRandomId(payload);
context.setCustomRecordId(recordId);
LOGGER.log(Level.INFO, "Random record ID : " + context.getCustomRecordId());
context.setCustomValToVerifyUpdateOperation(RandomStringUtils.randomAlphabetic(10));
payload = payload.replace("<CreateUniqueID>", recordId).replace("<RandomText>",
context.getCustomValToVerifyUpdateOperation());
commonMethods.postToStorage(payload);
LOGGER.log(Level.INFO, "Storage Post Response : " + context.getHttpResponse().getBody());
});
Then("Transformed record should be created in storage with {string}", (String tagsblock) -> {
String responseCode = commonMethods
.pollStorageForWksOfCustomRecordInContext(AutomationConstants.OS_TARGET_SCHEMA_KIND);
boolean recordCreatedOrUpdated = responseCode.equals(AutomationConstants.RECORD_CREATED)
| responseCode.equals(AutomationConstants.REQUEST_SUCCESS);
assertTrue(recordCreatedOrUpdated);
String wksResponseBody = commonMethods
.pollStorageForWksOfCustomRecordBodyInContext(AutomationConstants.OS_TARGET_SCHEMA_KIND);
JsonElement responseGiven = new Gson().fromJson(wksResponseBody, JsonElement.class);
JsonObject tagsResponseArray = responseGiven.getAsJsonObject().getAsJsonObject("tags");
String expectedMetaBody = context.getFileUtils().read(tagsblock);
JsonElement expectedJsonBody = new Gson().fromJson(expectedMetaBody, JsonElement.class);
JsonObject tagsExpectedArray = expectedJsonBody.getAsJsonObject().getAsJsonObject("tags");
assertTrue(tagsResponseArray.toString().contentEquals(tagsExpectedArray.toString()));
});
Then("Transformed records should be created in storage", () -> {
List<String> targetSchemaKinds = Arrays.asList(
AutomationConstants.TARGET_FOR_TESTSOURCE_C_TESTENTITY_C.get(0),
AutomationConstants.TARGET_FOR_TESTSOURCE_C_TESTENTITY_C.get(1));
List<String> responseCodes = commonMethods
.pollStorageForMultipleWksOfCustomRecordInContext(targetSchemaKinds);
for (String responseCode : responseCodes) {
boolean recordCreatedOrUpdated = responseCode.equals(AutomationConstants.RECORD_CREATED)
| responseCode.equals(AutomationConstants.REQUEST_SUCCESS);
assertTrue(recordCreatedOrUpdated);
}
});
And("Wks records should be created in the intended kind", () -> {
List<HttpResponse> httpResponseList = context.getResponseList();
for (int i = 0; i < httpResponseList.size(); i++) {
String expectedKind = AutomationConstants.TARGET_FOR_TESTSOURCE_C_TESTENTITY_C.get(i);
String actualKind = new JsonPath(httpResponseList.get(i).getBody()).get("kind").toString();
assertEquals(expectedKind, actualKind);
}
});
When("I hit Storage service put end point to update raw record with {string}", (String updatePayload) -> {
String payload = context.getFileUtils().read(updatePayload);
payload = commonMethods.updatePlaceholdersInInputPayload(payload);
String existingRecordInStorage = context.getCustomRecordId();
context.setCustomValToVerifyUpdateOperation(RandomStringUtils.randomAlphabetic(10));
payload = payload.replace("<CreateUniqueID>", existingRecordInStorage).replace("<RandomText>",
context.getCustomValToVerifyUpdateOperation());
context.setInputPayload(payload);
commonMethods.postToStorage(payload);
LOGGER.log(Level.INFO, "Storage Post Response : " + context.getHttpResponse().getBody());
});
Then("Existing WKS records in storage should get updated", () -> {
String initialWksRecordData = context.getCustomValToVerifyUpdateOperation();
String postUpdateWksRecordData = null;
List<HttpResponse> httpResponseList = context.getResponseList();
for (int i = 0; i < httpResponseList.size(); i++) {
long initial = System.currentTimeMillis();
while ((System.currentTimeMillis() - initial) < (AutomationConstants.RECORD_SEARCH_MAX_TIMEOUT_SEC)
* 1000) {
String wksId = new JsonPath(httpResponseList.get(i).getBody()).get("id").toString();
String responseCode = commonMethods.storageGetResponse(wksId);
if (responseCode.equals(AutomationConstants.REQUEST_SUCCESS)) {
postUpdateWksRecordData = new JsonPath(context.getHttpResponse().getBody()).get("data.uwi")
.toString();
if (initialWksRecordData.equalsIgnoreCase(postUpdateWksRecordData))
break;
}
}
LOGGER.log(Level.INFO, "Storage Response : " + context.getHttpResponse().getBody());
assertTrue("Expected: " + initialWksRecordData + " , Actual: " + postUpdateWksRecordData,
initialWksRecordData.equalsIgnoreCase(postUpdateWksRecordData));
}
});
Then("Raw Record should be created in Storage", () -> {
String rawRecordWithVersionForAncestry = null;
long initial = System.currentTimeMillis();
while ((System.currentTimeMillis() - initial) < (AutomationConstants.RECORD_SEARCH_MAX_TIMEOUT_SEC)
* 1000) {
String responseCode = commonMethods.storageGetResponse(context.getCustomRecordId());
if (responseCode.equals(AutomationConstants.REQUEST_SUCCESS)) {
String version = new JsonPath(context.getHttpResponse().getBody()).get("version").toString();
rawRecordWithVersionForAncestry = context.getCustomRecordId()
+ AutomationConstants.COLON_SEPARATOR + version;
context.setRawRecordWithVersionForAncestry(rawRecordWithVersionForAncestry);
LOGGER.log(Level.INFO, "ancestry value - " + rawRecordWithVersionForAncestry);
break;
}
}
});
And("Data block in wks should be transformed as defined in {string} as per {string}",
(String expectedWksRecord, String mappingFile) -> {
String actualWksDataBlock = new JsonPath(context.getHttpResponse().getBody()).get("data")
.toString();
String expectedWksDataBlock = new JsonPath(context.getFileUtils().read(expectedWksRecord))
.get("data").toString();
assertEquals("Expected: " + expectedWksDataBlock + " , Actual: " + actualWksDataBlock,
expectedWksDataBlock, actualWksDataBlock);
});
And("Ancestry block should be updated correctly", () -> {
String actualWksAncestry = new JsonPath(context.getHttpResponse().getBody()).get("ancestry.parents[0]")
.toString();
String expectedWksAncestry = context.getRawRecordWithVersionForAncestry();
assertEquals("Expected: " + expectedWksAncestry + " , Actual: " + actualWksAncestry, expectedWksAncestry,
actualWksAncestry);
commonMethods.deleteFromStorage(context.getCustomRecordId());
assertTrue(commonMethods.recordDeleted());
commonMethods.deleteFromStorage(context.getWksRecordIdForCustomRawRecord());
assertTrue(commonMethods.recordDeleted());
});
And("Metablock references in the transformed record should be updated as defined in {string} as per {string}",
(String expectedWksRecord, String mappingFile) -> {
String actualWksMetaBlock = new JsonPath(context.getHttpResponse().getBody()).get("meta")
.toString();
String expectedWksMetaBlock = new JsonPath(context.getFileUtils().read(expectedWksRecord))
.get("meta").toString();
assertEquals("Expected: " + expectedWksMetaBlock + " , Actual: " + actualWksMetaBlock,
expectedWksMetaBlock, actualWksMetaBlock);
});
And("Wks record should be created in the intended kind", () -> {
String expectedKind = AutomationConstants.OS_TARGET_SCHEMA_KIND;
String actualKind = new JsonPath(context.getHttpResponse().getBody()).get("kind").toString();
assertEquals(expectedKind, actualKind);
});
Then("Existing WKS record in storage should get updated", () -> {
String initialWksRecordData = context.getCustomValToVerifyUpdateOperation();
String postUpdateWksRecordData = null;
long initial = System.currentTimeMillis();
while ((System.currentTimeMillis() - initial) < (AutomationConstants.RECORD_SEARCH_MAX_TIMEOUT_SEC)
* 1000) {
String responseCode = commonMethods.storageGetResponse(context.getWksRecordIdForCustomRawRecord());
if (responseCode.equals(AutomationConstants.REQUEST_SUCCESS)) {
postUpdateWksRecordData = new JsonPath(context.getHttpResponse().getBody()).get("data.uwi")
.toString();
if (initialWksRecordData.equalsIgnoreCase(postUpdateWksRecordData))
break;
}
}
LOGGER.log(Level.INFO, "Storage Response : " + context.getHttpResponse().getBody());
assertTrue("Expected: " + initialWksRecordData + " , Actual: " + postUpdateWksRecordData,
initialWksRecordData.equalsIgnoreCase(postUpdateWksRecordData));
commonMethods.deleteFromStorage(context.getCustomRecordId());
assertTrue(commonMethods.recordDeleted());
commonMethods.deleteFromStorage(context.getWksRecordIdForCustomRawRecord());
assertTrue(commonMethods.recordDeleted());
});
When("I hit Storage service put end point with {string} having multiple records where few records are already Wks records",
(String bulkRecord) -> {
String payload = context.getFileUtils().read(bulkRecord);
payload = commonMethods.updatePlaceholdersInInputPayload(payload);
JsonArray bulkRecords = new Gson().fromJson(payload, JsonArray.class);
List<String> recordList = new ArrayList<String>();
recordList.add(commonMethods.generateRandomId(bulkRecords.get(0).toString()));
recordList.add(commonMethods.generateRawRecordId(AutomationConstants.OS_TARGET_SCHEMA_KIND_TENANT));
recordList.add(commonMethods.generateRandomId(bulkRecords.get(2).toString()));
context.setBulkRawRecordIdList(recordList);
payload = payload.replace("<CreateUniqueID1>", recordList.get(0))
.replace("<CreateUniqueID2>", recordList.get(1))
.replace("<CreateUniqueID3>", recordList.get(2));
LOGGER.log(Level.INFO, "Payload to Post : " + payload);
commonMethods.postToStorage(payload);
LOGGER.log(Level.INFO, "Storage Post Response : " + context.getHttpResponse().getBody());
});
Then("Transformation of Wks records should be skipped", () -> {
String responseCode = commonMethods.fetchRecordFromStorage(commonMethods.createWKSRecordId(
context.getBulkRawRecordIdList().get(1), AutomationConstants.OS_TARGET_SCHEMA_KIND));
assertEquals(AutomationConstants.RECORD_NOT_FOUND, responseCode);
});
And("All other valid records should get transformed", () -> {
String responseCode = commonMethods.fetchRecordFromStorage(commonMethods.createWKSRecordId(
context.getBulkRawRecordIdList().get(0), AutomationConstants.OS_TARGET_SCHEMA_KIND));
assertEquals(AutomationConstants.REQUEST_SUCCESS, responseCode);
responseCode = commonMethods.fetchRecordFromStorage(commonMethods.createWKSRecordId(
context.getBulkRawRecordIdList().get(2), AutomationConstants.OS_TARGET_SCHEMA_KIND));
assertEquals(AutomationConstants.REQUEST_SUCCESS, responseCode);
context.getBulkRawRecordIdList().forEach(recordId -> {
commonMethods.deleteFromStorage(recordId);
assertTrue(commonMethods.recordDeleted());
});
commonMethods.deleteFromStorage(commonMethods.createWksRecordIdFromCustomRawRecord(
context.getBulkRawRecordIdList().get(0), AutomationConstants.OS_TARGET_SCHEMA_KIND));
assertTrue(commonMethods.recordDeleted());
commonMethods.deleteFromStorage(commonMethods.createWksRecordIdFromCustomRawRecord(
context.getBulkRawRecordIdList().get(2), AutomationConstants.OS_TARGET_SCHEMA_KIND));
assertTrue(commonMethods.recordDeleted());
});
Then("Transformed record should be created in storage", () -> {
String responseCode = commonMethods.pollStorageForWksOfCustomRecordInContext(AutomationConstants.OS_TARGET_SCHEMA_KIND);
boolean recordCreatedOrUpdated = responseCode.equals(AutomationConstants.RECORD_CREATED)
| responseCode.equals(AutomationConstants.REQUEST_SUCCESS);
assertTrue(recordCreatedOrUpdated);
});
}
}
\ No newline at end of file
package org.opengroup.osdu.wks.stepdefs;
import java.util.logging.Level;
import java.util.logging.Logger;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.opengroup.osdu.wks.model.AutomationConstants;
import org.opengroup.osdu.wks.model.WksIntegrationTestScope;
import io.cucumber.java8.En;
public class NegativeTestStepDefs implements En {
public final static Logger LOGGER = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
CommonMethods commonMethods = new CommonMethods();
public WksIntegrationTestScope context = commonMethods.getContext();
public NegativeTestStepDefs() {
Given("I hit Storage service put end point with {string} which is already a WKS record",
(String inputPayload) -> {
String payload = context.getFileUtils().read(inputPayload);
payload = commonMethods.updatePlaceholdersInInputPayload(payload);
String recordId = commonMethods
.generateRawRecordId(AutomationConstants.OS_TARGET_SCHEMA_KIND_TENANT);
context.setCustomRecordId(recordId);
commonMethods.postToStorage(payload.replace("<CreateUniqueID>", recordId));
LOGGER.log(Level.INFO, "Storage Post Response : " + context.getHttpResponse().getBody());
assertEquals(String.valueOf(context.getHttpResponse().getCode()),
AutomationConstants.RECORD_CREATED);
});
Then("No corresponding transformed record should be created for this wks record in storage", () -> {
String responseCode = commonMethods
.pollStorageForAlreadyTransformedRecordType(AutomationConstants.OS_TARGET_SCHEMA_KIND);
assertEquals(AutomationConstants.RECORD_NOT_FOUND, responseCode);
commonMethods.deleteFromStorage(context.getCustomRecordId());
assertTrue(commonMethods.recordDeleted());
});
Given("I hit Storage service put end point with {string} which is already a WKE record",
(String inputPayload) -> {
String payload = context.getFileUtils().read(inputPayload);
payload = commonMethods.updatePlaceholdersInInputPayload(payload);
String kindVal = (AutomationConstants.OS_TARGET_SCHEMA_KIND_TENANT).replace("wks:", "wke:");
String recordId = commonMethods.generateRawRecordId(kindVal);
context.setCustomRecordId(recordId);
commonMethods.postToStorage(payload.replace("<CreateUniqueID>", recordId));
LOGGER.log(Level.INFO, "Storage Post Response : " + context.getHttpResponse().getBody());
assertEquals(String.valueOf(context.getHttpResponse().getCode()),
AutomationConstants.RECORD_CREATED);
});
Then("No corresponding transformed record should be created for this wke record in storage", () -> {
String responseCode = commonMethods.pollStorageForAlreadyTransformedRecordType(
(AutomationConstants.OS_TARGET_SCHEMA_KIND).replace("wks:", "wke:"));
assertEquals(AutomationConstants.RECORD_NOT_FOUND, responseCode);
commonMethods.deleteFromStorage(context.getCustomRecordId());
assertTrue(commonMethods.recordDeleted());
});
Given("I hit Storage service put end point with {string} which has invalid source so that mapping service does not return any mapping",
(String inputPayload) -> {
String payload = context.getFileUtils().read(inputPayload);
payload = commonMethods.updatePlaceholdersInInputPayload(payload);
String recordId = commonMethods.generateRandomId(payload);
context.setCustomRecordId(recordId);
LOGGER.log(Level.INFO, "Random record ID : " + context.getCustomRecordId());
payload = payload.replace("<CreateUniqueID>", recordId);
commonMethods.postToStorage(payload);
LOGGER.log(Level.INFO, "Storage Post Response : " + context.getHttpResponse().getBody());
assertEquals(String.valueOf(context.getHttpResponse().getCode()),
AutomationConstants.RECORD_CREATED);
});
Then("No corresponding transformed record should be created for this record in storage", () -> {
String responseCode = commonMethods.pollStorageForCurrentRecordInContext();
assertEquals(AutomationConstants.RECORD_NOT_FOUND, responseCode);
commonMethods.deleteFromStorage(context.getCustomRecordId());
assertTrue(commonMethods.recordDeleted());
});
}
}
package org.opengroup.osdu.wks.stepdefs;
import java.util.List;
import java.util.logging.Logger;
import org.opengroup.osdu.wks.model.WksIntegrationTestScope;
import io.cucumber.java8.En;
import io.cucumber.datatable.DataTable;
public class PreIntegrationStepDefs implements En {
public final static Logger LOGGER = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
CommonMethods commonMethods = new CommonMethods();
public WksIntegrationTestScope context = commonMethods.getContext();
public PreIntegrationStepDefs() {
Given("I create below source schemas used in Mapping files used for IT test", (DataTable sourceSchemaPaths) -> {
List<String> sourceSchemaPathsAsList = sourceSchemaPaths.asList();
for (String sourceSchemaPath : sourceSchemaPathsAsList) {
commonMethods.createSchemas(sourceSchemaPath);
}
});
And("I create below target schemas used in Mapping files used for IT test", (DataTable targetSchemaPaths) -> {
List<String> targetSchemaPathsAsList = targetSchemaPaths.asList();
for (String targetSchemaPath : targetSchemaPathsAsList) {
commonMethods.createSchemas(targetSchemaPath);
}
});
}
}
package org.opengroup.osdu.wks.stepdefs;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.lang3.RandomStringUtils;
import static org.junit.Assert.assertTrue;
import org.opengroup.osdu.wks.model.AutomationConstants;
import org.opengroup.osdu.wks.model.WksIntegrationTestScope;
import io.cucumber.java8.En;
public class RelationshipBlockTestStepDefs implements En {
public final static Logger LOGGER = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
CommonMethods commonMethods = new CommonMethods();
public WksIntegrationTestScope context = commonMethods.getContext();
public RelationshipBlockTestStepDefs() {
Given("I hit Storage service put end point with {string} to persist a record say raw1",
(String inputPayload) -> {
commonMethods.persistRecordToBeUsedInRelationshipBlock(inputPayload);
});
And("I verify that wks is created for above raw record", () -> {
String wksRecordId = commonMethods.getWksIdForRecordFromRequestPayloadArrayAtIndex(0,
AutomationConstants.OS_TARGET_SCHEMA_KIND);
String responseCode = commonMethods.pollStorageForWksOfRawInRelationshipBlock(wksRecordId);
boolean recordCreatedOrUpdated = responseCode.equals(AutomationConstants.RECORD_CREATED)
| responseCode.equals(AutomationConstants.REQUEST_SUCCESS);
assertTrue(recordCreatedOrUpdated);
commonMethods.staticWaitForIndexingToCommence();
});
Given("I hit Storage service put end point with {string} whose raw record contains relationship to record raw1",
(String parentInputPayload) -> {
commonMethods.persistRecordWithRelationshipBlock(parentInputPayload);
});
Then("Transformed record should contain relationship to wks of raw1 {string} as per {string}",
(String inputPayload, String expectedRelationshipBlock) -> {
List<String> ids = commonMethods.extractRecordIdFromPayload(inputPayload);
List<String> wksRecordIdsInRelationshipBlock = new ArrayList<>();
for (String id : ids) {
wksRecordIdsInRelationshipBlock.add(
this.commonMethods.createWKSRecordId(id, AutomationConstants.OS_TARGET_SCHEMA_KIND));
}
commonMethods.verifyRelationshipsBlockOfWksCreated(expectedRelationshipBlock,
wksRecordIdsInRelationshipBlock, AutomationConstants.OS_TARGET_SCHEMA_KIND);
});
Given("I hit Storage service put end point with {string} to persist two records say raw1 and raw2",
(String inputPayload) -> {
commonMethods.persistRecordToBeUsedInRelationshipBlock(inputPayload);
});
And("I verify that wks records are created for above raw records", () -> {
String wksRecordId = commonMethods.getWksIdForRecordFromRequestPayloadArrayAtIndex(0,
AutomationConstants.OS_TARGET_SCHEMA_KIND);
String responseCode = commonMethods.pollStorageForWksOfRawInRelationshipBlock(wksRecordId);
boolean recordCreatedOrUpdated = responseCode.equals(AutomationConstants.RECORD_CREATED)
| responseCode.equals(AutomationConstants.REQUEST_SUCCESS);
assertTrue(recordCreatedOrUpdated);
wksRecordId = commonMethods.getWksIdForRecordFromRequestPayloadArrayAtIndex(1,
AutomationConstants.OS_TARGET_SCHEMA_KIND);
responseCode = commonMethods.pollStorageForWksOfRawInRelationshipBlock(wksRecordId);
recordCreatedOrUpdated = responseCode.equals(AutomationConstants.RECORD_CREATED)
| responseCode.equals(AutomationConstants.REQUEST_SUCCESS);
assertTrue(recordCreatedOrUpdated);
commonMethods.staticWaitForIndexingToCommence();
});
Given("I hit storage service with {string} whose raw record contains relationship to above records",
(String inputPayload) -> {
commonMethods.persistRecordWithRelationshipBlock(inputPayload);
commonMethods.staticWaitForIndexingToCommence();
});
Then("Transformed record should contain relationship to wks records of raw1 and raw2 {string} as per {string}",
(String inputPayload, String expectedRelationshipBlock) -> {
List<String> ids = commonMethods.extractRecordIdFromPayload(inputPayload);
List<String> wksRecordIdsInRelationshipBlock = new ArrayList<>();
for (String id : ids) {
wksRecordIdsInRelationshipBlock.add(
this.commonMethods.createWKSRecordId(id, AutomationConstants.OS_TARGET_SCHEMA_KIND));
}
commonMethods.verifyRelationshipsBlockOfWksCreated(expectedRelationshipBlock,
wksRecordIdsInRelationshipBlock, AutomationConstants.OS_TARGET_SCHEMA_KIND);
});
Given("I hit Storage service put end point with {string} to persist a record,say raw1, for which there is no wks mapping present",
(String inputPayload) -> {
commonMethods.persistRecordToBeUsedInRelationshipBlock(inputPayload);
});
And("I verify that wks record does not get created for above raw record", () -> {
String wksRecordId = commonMethods.getWksIdForRecordFromRequestPayloadArrayAtIndex(0,
AutomationConstants.OS_TARGET_SCHEMA_KIND);
String responseCode = commonMethods.pollStorageForWksOfRawInRelationshipBlock(wksRecordId);
boolean recordCreatedOrUpdated = responseCode.equals(AutomationConstants.RECORD_NOT_FOUND);
assertTrue(recordCreatedOrUpdated);
});
Given("I hit storage service with {string} whose raw record contains relationship to record raw1",
(String inputPayload) -> {
commonMethods.persistRecordWithRelationshipBlock(inputPayload);
});
Then("Transformed record should contain relationship to raw record raw1 {string} as per {string}",
(String inputPayload, String expectedRelationshipBlock) -> {
List<String> recordIdsInRelationshipBlock = commonMethods.extractRecordIdFromPayload(inputPayload);
commonMethods.verifyRelationshipsBlockOfWksCreated(expectedRelationshipBlock,
recordIdsInRelationshipBlock, AutomationConstants.OS_TARGET_SCHEMA_KIND);
});
Given("I hit storage service with {string} whose raw record contains relationship to non-existing record,say raw1",
(String inputPayload) -> {
commonMethods.persistRecordWithRelationshipBlock(inputPayload);
});