diff --git a/provider/search-aws/src/main/resources/application.properties b/provider/search-aws/src/main/resources/application.properties index 77e9082e9b167a34fd94d9902619edd8e8f97564..b650814b835f546ea6fe7fffd21c3dd8ff8546aa 100644 --- a/provider/search-aws/src/main/resources/application.properties +++ b/provider/search-aws/src/main/resources/application.properties @@ -77,4 +77,4 @@ featureFlag.strategy=appProperty featureFlag.autocomplete.enabled=true #Collaboration context feature flag name : properties specific -collaborations-enabled=false +collaborations-enabled=true diff --git a/testing/integration-tests/search-test-aws/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/collaboration/RunTest.java b/testing/integration-tests/search-test-aws/src/test/java/org/opengroup/osdu/step_definitions/query/collaboration/RunTest.java similarity index 79% rename from testing/integration-tests/search-test-aws/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/collaboration/RunTest.java rename to testing/integration-tests/search-test-aws/src/test/java/org/opengroup/osdu/step_definitions/query/collaboration/RunTest.java index 97fbe0002f97f73f4717bd0308027b22e06a481e..e2607488327b7581b83b42f1b93122c2ec5ec183 100644 --- a/testing/integration-tests/search-test-aws/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/collaboration/RunTest.java +++ b/testing/integration-tests/search-test-aws/src/test/java/org/opengroup/osdu/step_definitions/query/collaboration/RunTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.opengroup.osdu.step_definitions.query.singlecluster.collaboration; +package org.opengroup.osdu.step_definitions.query.collaboration; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @@ -22,8 +22,8 @@ import org.junit.runner.RunWith; @RunWith(Cucumber.class) @CucumberOptions( - features = {"classpath:features/query/singlecluster/QueryCollaboration.feature"}, - glue = {"classpath:org.opengroup.osdu.step_definitions/query/singlecluster/collaboration"}, + features = {"classpath:features/query/collaboration/QueryCollaboration.feature"}, + glue = {"classpath:org/opengroup/osdu/step_definitions/query/collaboration"}, plugin = {"pretty", "junit:target/cucumber-reports/TEST-query-collaboration-sc.xml"}) public class RunTest { } diff --git a/testing/integration-tests/search-test-aws/src/test/java/org/opengroup/osdu/step_definitions/query/collaboration/Steps.java b/testing/integration-tests/search-test-aws/src/test/java/org/opengroup/osdu/step_definitions/query/collaboration/Steps.java new file mode 100644 index 0000000000000000000000000000000000000000..07b58ac6901e63eb879e0629d3d5c9366b96a0ff --- /dev/null +++ b/testing/integration-tests/search-test-aws/src/test/java/org/opengroup/osdu/step_definitions/query/collaboration/Steps.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2024. EPAM Systems, Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.opengroup.osdu.step_definitions.query.collaboration; + +import cucumber.api.DataTable; +import cucumber.api.Scenario; +import cucumber.api.java.Before; +import cucumber.api.java.en.Given; +import cucumber.api.java.en.Then; +import cucumber.api.java.en.When; +import org.opengroup.osdu.common.query.singlecluster.collaboration.QueryCollaborationSteps; +import org.opengroup.osdu.util.AWSHTTPClient; +import org.opengroup.osdu.util.Config; + +import java.util.List; + +public class Steps extends QueryCollaborationSteps { + + public Steps() { + super(new AWSHTTPClient()); + } + + @Given("^the schema is created with the following kind$") + public void the_schema_is_created_with_the_following_kind(DataTable dataTable) { + super.the_schema_is_created_with_the_following_kind(dataTable); + } + + @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); + } + @Before + public void before(Scenario scenario) { + this.scenario = scenario; + this.httpClient = new AWSHTTPClient(); + } + + /******************Inputs being set**************/ + + @When("^I limit the count of returned results to (-?\\d+)$") + public void i_limit_the_count_of_returned_results_to(int limit) { + super.i_limit_the_count_of_returned_results_to(limit); + } + + @When("^I send None with \"(.*?)\"$") + public void i_send_None_with(String kind) { + super.i_send_None_with(kind); + } + + @When("^I send \"(.*?)\" with \"(.*?)\"$") + public void i_send_with(String query, String kind) { + super.i_send_with(query, kind); + } + + @When("^I send \"(.*?)\" with (\\d+) copies of \"(.*?)\"$") + public void i_send_with_multi_kinds(String query, int number, String kind) { + super.i_send_with_multi_kinds(query, number, kind); + } + + @When("^I want the results sorted by (.*?)$") + public void i_sort_with(String sortJson) { + super.i_sort_with(sortJson); + } + + @When("^I want to aggregate by \"(.*?)\"$") + public void i_aggregate_by(String aggField) throws Throwable { + super.i_aggregate_by(aggField); + } + + @When("^I want to search as owner (.*?)$") + public void i_search_as(String isOwner) { + super.i_search_as(isOwner); + } + + @When("^I set the fields I want in response as ([\"(a-zA-Z0-9)\",?]*)$") + public void i_set_the_fields_I_want_in_response_as(List<String> returnedFileds) { + super.i_set_the_fields_I_want_in_response_as(returnedFileds); + } + + @When("^I set the offset of starting point as None$$|^I limit the count of returned results to None$$") + public void offset_of_starting_point_as_None() { + super.offset_of_starting_point_as_None(); + } + + @When("^I set the offset of starting point as (-?\\d+)$") + public void i_set_the_offset_of_starting_point_as(int offset) { + super.i_set_the_offset_of_starting_point_as(offset); + } + + @When("^I send request to tenant \"(.*?)\"$") + public void i_send_request_to_tenant(String tenant) { + super.i_send_request_to_tenant(tenant); + } + + @When("^I set autocomplete phrase to (.*?)$") + public void i_set_autocomplete_phrase(String autocompletePhrase) { + super.i_set_autocomplete_phrase(autocompletePhrase); + } + + @When("^I apply geographical query on field \"(.*?)\"$") + public void i_apply_geographical_query_on_field(String field) { + super.i_apply_geographical_query_on_field(field); + } + + @When("^define bounding box with points \\((-?\\d+), (-?\\d+)\\) and \\((-?\\d+), (-?\\d+)\\)$") + public void define_bounding_box_with_points_and(Double topLatitude, Double topLongitude, Double bottomLatitude, Double + bottomLongitude) { + super.define_bounding_box_with_points_and(topLatitude, topLongitude, bottomLatitude, bottomLongitude); + } + + @When("^define intersection polygon with points \\((-?\\d+), (-?\\d+)\\) and \\((-?\\d+), (-?\\d+)\\) and \\((-?\\d+), (-?\\d+)\\) and \\((-?\\d+), (-?\\d+)\\) and \\((-?\\d+), (-?\\d+)\\)") + public void define_intersection_polygon_with_points(Double latitude1, Double longitude1, Double latitude2, Double longitude2, + Double latitude3, Double longitude3, Double latitude4, Double longitude4, + Double latitude5, Double longitude5) { + super.define_intersection_polygon_with_points(latitude1, longitude1, latitude2, longitude2, latitude3, longitude3, latitude4, longitude4, latitude5, longitude5); + } + + @When("^define within polygon with points \\((-?\\d+), (-?\\d+)\\)") + public void define_within_polygon_with_points(Double latitude1, Double longitude1) { + super.define_within_polygon_with_points(latitude1, longitude1); + } + + /******************Assert final response**************/ + + @Then("^I should get in response (\\d+) records$") + public void i_should_get_in_response_records(int resultCount) { + super.i_should_get_in_response_records(resultCount); + } + + @Then("^I should get in response (\\d+) records with ([\"(a-zA-Z0-9)\",?]*)$") + public void i_should_get_in_response_records_with_fields(int resultCount, List<String> returnedFields) { + super.i_should_get_in_response_records(resultCount, returnedFields); + } + + @Then("^I should get records in right order first record id: \"(.*?)\", last record id: \"(.*?)\"$") + public void i_should_get_records_in_right_order(String firstRecId, String lastRecId) { + super.i_should_get_records_in_right_order(firstRecId, lastRecId); + } + + @Then("^I should get (\\d+) unique values") + public void i_should_get_aggregation_with_unique_values(int uniqueValueCount) { + super.i_should_get_aggregation_with_unique_values(uniqueValueCount); + } + + @Then("^I should get ([^\"]*) response with reason: \"(.*?)\", message: \"(.*?)\" and errors: \"(.*?)\"$") + public void i_should_get_response_with_reason_message_and_errors(List<Integer> codes, String type, String msg, String error) { + super.i_should_get_response_with_reason_message_and_errors(codes, type, msg, error); + } + + @Then("^I should get following autocomplete suggesstions (.*)") + public void i_should_get_following_autocomplete_suggestions(String autocompleteOptions) { + super.i_should_get_following_autocomplete_suggestions(autocompleteOptions); + } + + @When("^I ingest records with the \"(.*?)\" with \"(.*?)\" for a given \"(.*?)\" with \"(.*?)\" header$") + public void i_ingest_records_with_the_for_a_given_with_header(String record, String dataGroup, String kind, String xCollaborationHeader) { + super.i_ingest_records_with_the_for_a_given_with_header(record, dataGroup, kind, xCollaborationHeader); + } + + @When("^I send request with \"(.*?)\" header$") + public void i_send_request_with_xcolab_header(String xCollaborationHeader) { + super.i_send_request_with_xcollab_header(xCollaborationHeader); + } + + @Override + protected String getHttpMethod() { + return "POST"; + } + + @Override + protected String getApi() { + return Config.getSearchBaseURL() + "query"; + } +} diff --git a/testing/integration-tests/search-test-aws/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/collaboration/Steps.java b/testing/integration-tests/search-test-aws/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/collaboration/Steps.java deleted file mode 100644 index 8ce2cd660795fd913f10ee12f102346a403c7ee3..0000000000000000000000000000000000000000 --- a/testing/integration-tests/search-test-aws/src/test/java/org/opengroup/osdu/step_definitions/query/singlecluster/collaboration/Steps.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2024. EPAM Systems, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.opengroup.osdu.step_definitions.query.singlecluster.collaboration; - - -import cucumber.api.DataTable; -import cucumber.api.Scenario; -import cucumber.api.java.Before; -import cucumber.api.java.en.Given; -import cucumber.api.java.en.Then; -import cucumber.api.java.en.When; -import org.opengroup.osdu.common.query.singlecluster.collaboration.QueryCollaborationSteps; -import org.opengroup.osdu.util.AWSHTTPClient; -import org.opengroup.osdu.util.Config; - -import java.util.List; - -public class Steps extends QueryCollaborationSteps { - - public Steps() { - super(new AWSHTTPClient()); - } - - @When("^I ingest records with the \"(.*?)\" with \"(.*?)\" for a given \"(.*?)\" with \"(.*?)\" header$") - public void i_ingest_records_with_the_for_a_given_with_header(String record, String dataGroup, String kind, String xCollaborationHeader) { - super.i_ingest_records_with_the_for_a_given_with_header(record, dataGroup, kind, xCollaborationHeader); - } - - @When("^I send request with \"(.*?)\" header$") - public void i_send_request_with_xcolab_header(String xCollaborationHeader) { - super.i_send_request_with_xcollab_header(xCollaborationHeader); - } - - @Override - protected String getHttpMethod() { - return "POST"; - } - - @Override - protected String getApi() { - return Config.getSearchBaseURL() + "query"; - } -} diff --git a/testing/integration-tests/search-test-aws/src/test/resources/cucumber.properties b/testing/integration-tests/search-test-aws/src/test/resources/cucumber.properties index 85d5d3af2c4e7b388a0a8013dcf111274b6c7b38..ea1029e4c5ebfb98becebab48e2992e2ac55833b 100644 --- a/testing/integration-tests/search-test-aws/src/test/resources/cucumber.properties +++ b/testing/integration-tests/search-test-aws/src/test/resources/cucumber.properties @@ -1,2 +1,2 @@ # tag autocomplete enabled by default -cucumber.options=--tags '@autocomplete,@default' +cucumber.options=--tags '@autocomplete,@default,@xcollab' diff --git a/testing/integration-tests/search-test-core/src/main/resources/features/query/singlecluster/QueryCollaboration.feature b/testing/integration-tests/search-test-core/src/main/resources/features/query/collaboration/QueryCollaboration.feature similarity index 100% rename from testing/integration-tests/search-test-core/src/main/resources/features/query/singlecluster/QueryCollaboration.feature rename to testing/integration-tests/search-test-core/src/main/resources/features/query/collaboration/QueryCollaboration.feature diff --git a/testing/integration-tests/search-test-core/src/main/resources/features/query/singlecluster/SystemMetadata.feature b/testing/integration-tests/search-test-core/src/main/resources/features/query/singlecluster/SystemMetadata.feature index 8776baf96db21e4dd3f37e40ac92d5262506d003..48e959d7acd9b0740064638fc92ed4a2dc579085 100644 --- a/testing/integration-tests/search-test-core/src/main/resources/features/query/singlecluster/SystemMetadata.feature +++ b/testing/integration-tests/search-test-core/src/main/resources/features/query/singlecluster/SystemMetadata.feature @@ -11,7 +11,7 @@ Feature: Search with different queries | system-meta-data:system<timestamp>:test-data--Integration:2.0.0 | metadata_test_records_5 | | system-meta-data:system<timestamp>:test-data--Integration:2.1.0 | metadata_test_records_6 | - + @default Scenario Outline: Ingest records for the given kind When I ingest records with the <recordFile> with <acl> for a given <kind> Examples: @@ -23,7 +23,7 @@ Feature: Search with different queries | "system-meta-data:system<timestamp>:test-data--Integration:2.0.0" | "metadata_test_records_5" | "data.default.viewers@tenant1" | | "system-meta-data:system<timestamp>:test-data--Integration:2.1.0" | "metadata_test_records_6" | "data.default.viewers@tenant1" | - + @default Scenario Outline: Search data in a given kind with aggregateBy field When I send <query> with <kind> And I want to aggregate by <aggregateBy>