From 4d794925d215f84de6f62932eb6c5f06aeb9aad9 Mon Sep 17 00:00:00 2001 From: Vamsi Manohar Date: Mon, 29 Jul 2024 09:59:22 -0700 Subject: [PATCH] Fix Integ test for datasource enabled setting with security plugin Signed-off-by: Vamsi Manohar --- .../sql/datasource/DataSourceEnabledIT.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/integ-test/src/test/java/org/opensearch/sql/datasource/DataSourceEnabledIT.java b/integ-test/src/test/java/org/opensearch/sql/datasource/DataSourceEnabledIT.java index 480a6dc563..5c6045b95b 100644 --- a/integ-test/src/test/java/org/opensearch/sql/datasource/DataSourceEnabledIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/datasource/DataSourceEnabledIT.java @@ -6,7 +6,6 @@ package org.opensearch.sql.datasource; import static org.opensearch.sql.legacy.TestUtils.getResponseBody; -import static org.opensearch.sql.legacy.TestsConstants.DATASOURCES; import lombok.SneakyThrows; import org.json.JSONObject; @@ -28,7 +27,6 @@ protected boolean preserveClusterUponCompletion() { public void testDataSourceIndexIsCreatedByDefault() { assertDataSourceCount(0); assertSelectFromDataSourceReturnsDoesNotExist(); - assertDataSourceIndexCreated(true); } @Test @@ -36,7 +34,6 @@ public void testDataSourceIndexIsCreatedIfSettingIsEnabled() { setDataSourcesEnabled("transient", true); assertDataSourceCount(0); assertSelectFromDataSourceReturnsDoesNotExist(); - assertDataSourceIndexCreated(true); } @Test @@ -44,7 +41,6 @@ public void testDataSourceIndexIsNotCreatedIfSettingIsDisabled() { setDataSourcesEnabled("transient", false); assertDataSourceCount(0); assertSelectFromDataSourceReturnsDoesNotExist(); - assertDataSourceIndexCreated(false); assertAsyncQueryApiDisabled(); } @@ -141,18 +137,6 @@ private void assertDataSourceCount(int expected) { Assert.assertEquals(expected, jsonBody.getJSONArray("datarows").length()); } - @SneakyThrows - private void assertDataSourceIndexCreated(boolean expected) { - Request request = new Request("GET", "/" + DATASOURCES); - Response response = performRequest(request); - String responseBody = getResponseBody(response); - boolean indexDoesExist = - response.getStatusLine().getStatusCode() == 200 - && responseBody.contains(DATASOURCES) - && responseBody.contains("mappings"); - Assert.assertEquals(expected, indexDoesExist); - } - @SneakyThrows private Response performRequest(Request request) { try {