Skip to content
Snippets Groups Projects
Commit c138b3af authored by Zhibin Mai's avatar Zhibin Mai
Browse files

Enhancement integration tests

parent 49a12aef
Branches
Tags
4 merge requests!545Draft: add env variables,!543Draft: az/sa-support-index-extended-properties,!540Draft: support index extended properties,!465Index extended properties defined in property configurations
Pipeline #184197 failed
......@@ -46,6 +46,16 @@ public class Steps extends SchemaServiceRecordSteps {
super.the_schema_is_created_with_the_following_kind(dataTable);
}
@Then("^I set starting stateful scenarios$")
public void i_set_starting_stateful_scenarios() throws Throwable {
super.i_set_scenarios_as_stateful(true);
}
@Then("^I set ending stateful scenarios$")
public void i_set_ending_stateful_scenarios() throws Throwable {
super.i_set_scenarios_as_stateful(false);
}
@When("^I ingest records with the \"(.*?)\" with \"(.*?)\" for a given \"(.*?)\"$")
public void i_ingest_records_with_the_for_a_given(String record, String dataGroup, String kind) {
super.i_ingest_records_with_the_for_a_given(record, dataGroup, kind);
......
......@@ -75,6 +75,16 @@ public class Steps extends SchemaServiceRecordSteps {
super.the_schema_is_created_with_the_following_kind(dataTable);
}
@Then("^I set starting stateful scenarios$")
public void i_set_starting_stateful_scenarios() throws Throwable {
super.i_set_scenarios_as_stateful(true);
}
@Then("^I set ending stateful scenarios$")
public void i_set_ending_stateful_scenarios() throws Throwable {
super.i_set_scenarios_as_stateful(false);
}
@When("^I ingest records with the \"(.*?)\" with \"(.*?)\" for a given \"(.*?)\"$")
public void i_ingest_records_with_the_for_a_given(String record, String dataGroup, String kind) {
super.i_ingest_records_with_the_for_a_given(record, dataGroup, kind);
......
......@@ -43,6 +43,16 @@ public class Steps extends SchemaServiceRecordSteps {
super.the_schema_is_created_with_the_following_kind(dataTable);
}
@Then("^I set starting stateful scenarios$")
public void i_set_starting_stateful_scenarios() throws Throwable {
super.i_set_scenarios_as_stateful(true);
}
@Then("^I set ending stateful scenarios$")
public void i_set_ending_stateful_scenarios() throws Throwable {
super.i_set_scenarios_as_stateful(false);
}
@When("^I ingest records with the \"(.*?)\" with \"(.*?)\" for a given \"(.*?)\"$")
public void i_ingest_records_with_the_for_a_given(String record, String dataGroup, String kind) {
super.i_ingest_records_with_the_for_a_given(record, dataGroup, kind);
......
......@@ -10,22 +10,24 @@ import java.util.List;
import java.util.Map;
public class SchemaServiceRecordSteps extends RecordSteps {
private static boolean runBackgroundOnce = false;
private static boolean runStatefulScenario = false;
public SchemaServiceRecordSteps(HTTPClient httpClient, ElasticUtils elasticUtils) {
super(httpClient, elasticUtils);
}
public void the_schema_is_created_with_the_following_kind(DataTable dataTable) {
if(!runBackgroundOnce) {
if(!SchemaServiceRecordSteps.runStatefulScenario) {
List<Setup> inputList = dataTable.asList(Setup.class);
inputList.forEach(this::setup);
super.addShutDownHook();
runBackgroundOnce = true;
}
}
public void i_set_scenarios_as_stateful(boolean stateful) throws Throwable {
SchemaServiceRecordSteps.runStatefulScenario = stateful;
}
private void setup(Setup input) {
PersistentSchemaTestIndex testIndex = new PersistentSchemaTestIndex(super.elasticUtils, super.httpClient, this);
testIndex.setIndex(generateActualName(input.getIndex(), super.getTimeStamp()));
......
......@@ -23,6 +23,7 @@ Feature: Indexing of the documents
When I ingest records with the <recordFile> with <acl> for a given <kind>
Then I should get the <number> documents for the <index> in the Elastic Search
Then I clean up the index of the extended kinds <extendedKinds> in the Elastic Search
Then I set starting stateful scenarios
Examples:
| kind | recordFile | number | index | acl | extendedKinds |
......@@ -46,6 +47,8 @@ Feature: Indexing of the documents
| "test:indexer:index-property--Wellbore:1.0.0" | "index-property-wellbore_v1" | 1 | "test-indexer-index-property--wellbore-1.0.0" | "data.default.viewers@tenant1" | "data.Location" | 30 | -96 | 29 | -95 |
| "test:indexer:index-property--WellLog:1.0.0" | "index-property-welllog_v1" | 1 | "test-indexer-index-property--welllog-1.0.0" | "data.default.viewers@tenant1" | "data.SpatialLocation" | 30 | -96 | 29 | -95 |
Scenario: End Stateful Scenarios
Then I set ending stateful scenarios
Scenario Outline: Ingest the record and Index in the Elastic Search
When I ingest records with the <recordFile> with <acl> for a given <kind>
......
......@@ -29,6 +29,16 @@ public class Steps extends SchemaServiceRecordSteps {
super.the_schema_is_created_with_the_following_kind(dataTable);
}
@Then("^I set starting stateful scenarios$")
public void i_set_starting_stateful_scenarios() throws Throwable {
super.i_set_scenarios_as_stateful(true);
}
@Then("^I set ending stateful scenarios$")
public void i_set_ending_stateful_scenarios() throws Throwable {
super.i_set_scenarios_as_stateful(false);
}
@When("^I ingest records with the \"(.*?)\" with \"(.*?)\" for a given \"(.*?)\"$")
public void i_ingest_records_with_the_for_a_given(String record, String dataGroup, String kind) {
super.i_ingest_records_with_the_for_a_given(record, dataGroup, kind);
......
......@@ -48,6 +48,16 @@ public class Steps extends SchemaServiceRecordSteps {
super.the_schema_is_created_with_the_following_kind(dataTable);
}
@Then("^I set starting stateful scenarios$")
public void i_set_starting_stateful_scenarios() throws Throwable {
super.i_set_scenarios_as_stateful(true);
}
@Then("^I set ending stateful scenarios$")
public void i_set_ending_stateful_scenarios() throws Throwable {
super.i_set_scenarios_as_stateful(false);
}
@When("^I ingest records with the \"(.*?)\" with \"(.*?)\" for a given \"(.*?)\"$")
public void i_ingest_records_with_the_for_a_given(String record, String dataGroup, String kind) {
super.i_ingest_records_with_the_for_a_given(record, dataGroup, kind);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment