From 8c37b2d1e28f435e8f3bebf3149618d6a26edebe Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Fri, 13 Oct 2023 22:43:47 -0700 Subject: [PATCH] [Backport 2.x] Fixed testPluginInstalled failure (#92) (#93) Fixed testPluginInstalled failure (#92) (cherry picked from commit 1b856deadeccfe0b87e572d8cfbb6909da70d1c7) Signed-off-by: Owais Kazi --- .../flowframework/FlowFrameworkPluginIT.java | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/test/java/org/opensearch/flowframework/FlowFrameworkPluginIT.java b/src/test/java/org/opensearch/flowframework/FlowFrameworkPluginIT.java index e85a79b17..fe0af8ba0 100644 --- a/src/test/java/org/opensearch/flowframework/FlowFrameworkPluginIT.java +++ b/src/test/java/org/opensearch/flowframework/FlowFrameworkPluginIT.java @@ -8,33 +8,22 @@ */ package org.opensearch.flowframework; -import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope; - import org.apache.http.util.EntityUtils; import org.opensearch.client.Request; import org.opensearch.client.Response; -import org.opensearch.plugins.Plugin; -import org.opensearch.test.OpenSearchIntegTestCase; +import org.opensearch.test.rest.OpenSearchRestTestCase; import java.io.IOException; import java.nio.charset.StandardCharsets; -import java.util.Collection; -import java.util.Collections; - -@ThreadLeakScope(ThreadLeakScope.Scope.NONE) -@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.SUITE) -public class FlowFrameworkPluginIT extends OpenSearchIntegTestCase { - @Override - protected Collection> nodePlugins() { - return Collections.singletonList(FlowFrameworkPlugin.class); - } +public class FlowFrameworkPluginIT extends OpenSearchRestTestCase { public void testPluginInstalled() throws IOException { - Response response = createRestClient().performRequest(new Request("GET", "/_cat/plugins")); + Response response = client().performRequest(new Request("GET", "/_cat/plugins")); String body = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); logger.info("response body: {}", body); - assertTrue(body.contains("flowframework")); + assertNotNull(body); + assertTrue(body.contains("opensearch-flow-framework")); } }