From 7ec6bf87be800d0931dbc5590e122d742c844ba9 Mon Sep 17 00:00:00 2001 From: Vamsi Manohar Date: Mon, 25 Mar 2024 20:16:29 -0700 Subject: [PATCH] Removing old datasources model test Signed-off-by: Vamsi Manohar --- .../sql/datasource/DataSourceAPIsIT.java | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/integ-test/src/test/java/org/opensearch/sql/datasource/DataSourceAPIsIT.java b/integ-test/src/test/java/org/opensearch/sql/datasource/DataSourceAPIsIT.java index 70bece480a..05e19f8285 100644 --- a/integ-test/src/test/java/org/opensearch/sql/datasource/DataSourceAPIsIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/datasource/DataSourceAPIsIT.java @@ -11,10 +11,7 @@ import static org.opensearch.sql.datasources.utils.XContentParserUtils.DESCRIPTION_FIELD; import static org.opensearch.sql.datasources.utils.XContentParserUtils.NAME_FIELD; import static org.opensearch.sql.datasources.utils.XContentParserUtils.STATUS_FIELD; -import static org.opensearch.sql.legacy.TestUtils.createIndexByRestClient; import static org.opensearch.sql.legacy.TestUtils.getResponseBody; -import static org.opensearch.sql.legacy.TestUtils.isIndexExist; -import static org.opensearch.sql.legacy.TestUtils.loadDataByRestClient; import com.google.common.collect.ImmutableMap; import com.google.gson.Gson; @@ -70,10 +67,6 @@ protected static void deleteDataSourcesCreated() throws IOException { deleteRequest = getDeleteDataSourceRequest("patch_prometheus"); deleteResponse = client().performRequest(deleteRequest); Assert.assertEquals(204, deleteResponse.getStatusLine().getStatusCode()); - - deleteRequest = getDeleteDataSourceRequest("old_prometheus"); - deleteResponse = client().performRequest(deleteRequest); - Assert.assertEquals(204, deleteResponse.getStatusLine().getStatusCode()); } @SneakyThrows @@ -392,35 +385,6 @@ public void patchDataSourceAPITest() { Assert.assertEquals("test", dataSourceMetadata.getDescription()); } - @SneakyThrows - @Test - public void testOldDataSourceModelLoadingThroughGetDataSourcesAPI() { - Index index = Index.DATASOURCES; - String indexName = index.getName(); - String mapping = index.getMapping(); - String dataSet = index.getDataSet(); - if (!isIndexExist(client(), indexName)) { - createIndexByRestClient(client(), indexName, mapping); - } - loadDataByRestClient(client(), indexName, dataSet); - // waiting for loaded indices. - Thread.sleep(1000); - // get datasource to validate the creation. - Request getRequest = getFetchDataSourceRequest(null); - Response getResponse = client().performRequest(getRequest); - Assert.assertEquals(200, getResponse.getStatusLine().getStatusCode()); - String getResponseString = getResponseBody(getResponse); - Type listType = new TypeToken>() {}.getType(); - List dataSourceMetadataList = - new Gson().fromJson(getResponseString, listType); - Assert.assertTrue( - dataSourceMetadataList.stream() - .anyMatch( - dataSourceMetadata -> - dataSourceMetadata.getName().equals("old_prometheus") - && dataSourceMetadata.getStatus().equals(ACTIVE))); - } - public DataSourceMetadata mockDataSourceMetadata(String name) { return new DataSourceMetadata.Builder() .setName(name)