Commit 2a8c144a authored by Smitha Manjunath's avatar Smitha Manjunath
Browse files

removed elasticUtils.java and its usages in core modules.

parent 82e26db2
Pipeline #96619 failed with stages
in 7 seconds
......@@ -43,7 +43,7 @@ public abstract class TestsBase {
protected SpatialFilter spatialFilter = new SpatialFilter();
protected SpatialFilter.ByBoundingBox byBoundingBox;
protected String timeStamp = String.valueOf(System.currentTimeMillis());
protected static final String timeStamp = String.valueOf(System.currentTimeMillis()) ;
private boolean dunit = false;
public TestsBase(HTTPClient httpClient) {
......@@ -142,11 +142,11 @@ public abstract class TestsBase {
return null;
}
protected String generateActualName(String rawName, String timeStamp) {
public String generateActualName(String rawName, String timeStamp) {
for (String tenant : tenantMap.keySet()) {
rawName = rawName.replaceAll(tenant, getTenantMapping(tenant));
}
return rawName.replaceAll("<timestamp>", timeStamp);
return rawName.replaceAll("<timestamp>", this.timeStamp);
}
protected Legal generateLegalTag() {
......@@ -219,7 +219,7 @@ public abstract class TestsBase {
String authority = tenantMap.get(kindParts[0]);
String source = kindParts[1];
testRecord.put("authority", authority);
testRecord.put("source", source);
testRecord.put("source", generateActualName(source,timeStamp));
testRecord.put("createUser", "TestUser");
testRecord.put("createTime", createTime);
}
......
......@@ -45,6 +45,7 @@ public class PersistentSchemaTestIndex extends TestIndex {
SchemaIdentity schemaIdentity = schemaModel.getSchemaInfo().getSchemaIdentity();
LOGGER.log(Level.INFO, "Read the schema={0}", schemaIdentity);
schemaIdentity.setAuthority(testsBase.generateActualNameWithoutTs(schemaIdentity.getAuthority()));
schemaIdentity.setSource(testsBase.generateActualName(schemaIdentity.getSource(),""));
LOGGER.log(Level.INFO, "Updated the schema={0}", schemaIdentity);
schemaServiceClient.createIfNotExist(schemaModel);
LOGGER.log(Level.INFO, "Finished setting up the schema={0}", schemaIdentity);
......
......@@ -4,15 +4,15 @@ Feature: Search recursively on cursor with different queries
Background:
Given the schema is created with the following kind
| kind | schemaFile |
| tenant1:search:test-data--Integration:1.0.1 | records_1 |
| tenant1:search:test-data2--Integration:1.0.2 | records_2 |
| tenant1:search<timestamp>:test-data--Integration:1.0.1 | records_1 |
| tenant1:search<timestamp>:test-data2--Integration:1.0.2 | records_2 |
Scenario Outline: Ingest records for the given kind
When I ingest records with the <recordFile> with <acl> for a given <kind>
Examples:
| kind | recordFile | acl |
| "tenant1:search:test-data--Integration:1.0.1" | "records_1" | "data.default.viewers@tenant1" |
| "tenant1:search:test-data2--Integration:1.0.2" | "records_2" | "data.default.viewers@tenant1" |
| "tenant1:search<timestamp>:test-data--Integration:1.0.1" | "records_1" | "data.default.viewers@tenant1" |
| "tenant1:search<timestamp>:test-data2--Integration:1.0.2" | "records_2" | "data.default.viewers@tenant1" |
Scenario Outline: Search recursively page by page data across the kinds
When I send <query> with <kind>
......@@ -25,11 +25,11 @@ Feature: Search recursively on cursor with different queries
Examples:
| q1_tenant | q2_tenant | kind | query | limit | returned_fields | first_count | final_count |
| "tenant1" | "tenant1" | "tenant1:search:*:*" | None | 4 | All | 4 | 2 |
| "tenant1" | "tenant1" | "tenant1:search:*:*" | None | None | All | 6 | 0 |
| "tenant1" | "tenant1" | "tenant1:search:*:*" | "TX OR TEXAS OR FRANCE" | 1 | All | 1 | 1 |
| "tenant1" | "tenant1" | "tenant1:search:*:*" | "XdQQ6GCSNSBLTESTFAIL" | 1 | All | 0 | 0 |
| "tenant1" | "tenant1" | "tenant1:search:*:*" | "\"OFFICE2\" \| OFFICE3 \| OFFICE5" | 1 | All | 1 | 1 |
| "tenant1" | "tenant1" | "tenant1:search<timestamp>:*:*" | None | 4 | All | 4 | 2 |
| "tenant1" | "tenant1" | "tenant1:search<timestamp>:*:*" | None | None | All | 6 | 0 |
| "tenant1" | "tenant1" | "tenant1:search<timestamp>:*:*" | "TX OR TEXAS OR FRANCE" | 1 | All | 1 | 1 |
| "tenant1" | "tenant1" | "tenant1:search<timestamp>:*:*" | "XdQQ6GCSNSBLTESTFAIL" | 1 | All | 0 | 0 |
| "tenant1" | "tenant1" | "tenant1:search<timestamp>:*:*" | "\"OFFICE2\" \| OFFICE3 \| OFFICE5" | 1 | All | 1 | 1 |
Scenario Outline: Search recursively page by page data across the kinds with invalid inputs
When I send <query> with <kind>
......@@ -40,9 +40,9 @@ Feature: Search recursively on cursor with different queries
Examples:
| tenant | kind | query | limit | response_code | reponse_type | response_message | errors |
| "tenant1" | "tenant1:search:test-data--Integration:1.0.1" | None | None | 400 | "Can't find the given cursor" | "The given cursor is invalid or expired" | "" |
| "tenant1" | "*:*:*" | None | 0 | 400 | "Bad Request" | "Invalid parameters were given on search request" | "Not a valid record kind. Found: *:*:*" |
| "tenant1" | "tenant1:search:test-data--Integration:1.0.1" | None | -1 | 400 | "Bad Request" | "Invalid parameters were given on search request" | "'limit' must be equal or greater than 0" |
| "tenant1" | "tenant1:search<timestamp>:test-data--Integration:1.0.1" | None | None | 400 | "Can't find the given cursor" | "The given cursor is invalid or expired" | "" |
| "tenant1" | "*:*:*" | None | 0 | 400 | "Bad Request" | "Invalid parameters were given on search request" | "Not a valid record kind format. Found: *:*:*" |
| "tenant1" | "tenant1:search<timestamp>:test-data--Integration:1.0.1" | None | -1 | 400 | "Bad Request" | "Invalid parameters were given on search request" | "'limit' must be equal or greater than 0" |
Scenario Outline: Search recursively page by page data across the kinds with invalid inputs and headers
When I send <query> with <kind>
......@@ -55,7 +55,7 @@ Feature: Search recursively on cursor with different queries
Examples:
| q1_tenant | q2_tenant | kind | query | limit | returned_fields | first_count | response_code | reponse_type | response_message | errors |
| "tenant1" | "common" | "tenant1:search:test-data--Integration:1.0.1" | None | 1 | All | 1 | 401 | "Access denied" | "The user is not authorized to perform this action" | "" |
| "tenant1" | "common" | "tenant1:search<timestamp>:test-data--Integration:1.0.1" | None | 1 | All | 1 | 401 | "Access denied" | "The user is not authorized to perform this action" | "" |
Scenario Outline: Search data across the kinds with bounding box inputs
When I send <query> with <kind>
......@@ -69,8 +69,8 @@ Feature: Search recursively on cursor with different queries
Examples:
| q1_tenant | q2_tenant | kind | query | limit | field | top_left_latitude | top_left_longitude | bottom_right_latitude | bottom_right_longitude | first_count | final_count |
| "tenant1" | "tenant1" | "tenant1:search:test-data--Integration:1.0.1" | None | None | "data.Location" | 45 | -100 | 0 | 0 | 2 | 0 |
| "tenant1" | "tenant1" | "tenant1:search:test-data--Integration:1.0.1" | "OFFICE4" | 1 | "data.Location" | 45 | -110 | 0 | 0 | 1 | 0 |
| "tenant1" | "tenant1" | "tenant1:search<timestamp>:test-data--Integration:1.0.1" | None | None | "data.Location" | 45 | -100 | 0 | 0 | 2 | 0 |
| "tenant1" | "tenant1" | "tenant1:search<timestamp>:test-data--Integration:1.0.1" | "OFFICE4" | 1 | "data.Location" | 45 | -110 | 0 | 0 | 1 | 0 |
Scenario Outline: Search data and sort the results with the given sort fields and order
......@@ -79,6 +79,6 @@ Feature: Search recursively on cursor with different queries
Then I should get records in right order first record id: <first_record_id>, last record id: <last_record_id>
Examples:
| kind | query | sort | first_record_id | last_record_id |
| "tenant1:search:*:*" | None | {"field":["data.OriginalOperator"],"order":["ASC"]} | "tenant1:search:1" | "tenant1:search2:3" |
| "tenant1:search:*:*" | None | {"field":["id"],"order":["DESC"]} | "tenant1:search:3" | "tenant1:search2:1" |
| "tenant1:search:*:*" | None | {"field":["namespace","data.Rank"],"order":["ASC","DESC"]} | "tenant1:search:3" | "tenant1:search2:1" |
| "tenant1:search<timestamp>:*:*" | None | {"field":["data.OriginalOperator"],"order":["ASC"]} | "tenant1:search<timestamp>:1" | "tenant1:search2<timestamp>:3" |
| "tenant1:search<timestamp>:*:*" | None | {"field":["id"],"order":["DESC"]} | "tenant1:search2<timestamp>:3" | "tenant1:search<timestamp>:1" |
| "tenant1:search<timestamp>:*:*" | None | {"field":["namespace","data.Rank"],"order":["ASC","DESC"]} | "tenant1:search<timestamp>:3" | "tenant1:search2<timestamp>:1" |
[
{
"id": "tenant1:search:1",
"id": "tenant1:search<timestamp>:1",
"tags": {
"testtag": "testvalue"
},
......@@ -24,7 +24,7 @@
}
},
{
"id": "tenant1:search:2",
"id": "tenant1:search<timestamp>:2",
"tags": {
"testtag": "testvalue"
},
......@@ -49,7 +49,7 @@
}
},
{
"id": "tenant1:search:3",
"id": "tenant1:search<timestamp>:3",
"tags": {
"testtag": "testvalue"
},
......
......@@ -2,7 +2,7 @@
"schemaInfo": {
"schemaIdentity": {
"authority": "tenant1",
"source": "search",
"source": "search<timestamp>",
"entityType": "test-data--Integration",
"schemaVersionMajor": "1",
"schemaVersionMinor": "0",
......
[
{
"id": "tenant1:search2:1",
"id": "tenant1:search2<timestamp>:1",
"tags": {
"testtag": "testvalue"
},
......@@ -25,7 +25,7 @@
}
},
{
"id": "tenant1:search2:2",
"id": "tenant1:search2<timestamp>:2",
"tags": {
"testtag": "testvalue"
},
......@@ -50,7 +50,7 @@
}
},
{
"id": "tenant1:search2:3",
"id": "tenant1:search2<timestamp>:3",
"tags": {
"testtag": "testvalue"
},
......
......@@ -2,7 +2,7 @@
"schemaInfo": {
"schemaIdentity": {
"authority": "tenant1",
"source": "search",
"source": "search<timestamp>",
"entityType": "test-data2--Integration",
"schemaVersionMajor": "1",
"schemaVersionMinor": "0",
......
[{
"id": "tenant1:well:1",
"id": "tenant1:well<timestamp>:1",
"tags": {
"testtag": "testvalue"
},
......@@ -34,7 +34,7 @@
},
{
"id": "tenant1:well:2",
"id": "tenant1:well<timestamp>:2",
"data": {
"Source": "Example Data Source",
"FacilityName": "Example FacilityName",
......
......@@ -2,7 +2,7 @@
"schemaInfo": {
"schemaIdentity": {
"authority": "tenant1",
"source": "well",
"source": "well<timestamp>",
"entityType": "test-data3--Integration",
"schemaVersionMajor": "1",
"schemaVersionMinor": "0",
......
Supports Markdown
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