From 6a459c296c528c49e0b3a0249d18d3d0620a3052 Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Fri, 13 Oct 2023 12:15:09 -0700 Subject: [PATCH] Fixed testPluginInstalled failure 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 0dccc27ce..31e58882f 100644 --- a/src/test/java/org/opensearch/flowframework/FlowFrameworkPluginIT.java +++ b/src/test/java/org/opensearch/flowframework/FlowFrameworkPluginIT.java @@ -8,34 +8,23 @@ */ package org.opensearch.flowframework; -import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope; - import org.apache.hc.core5.http.ParseException; import org.apache.hc.core5.http.io.entity.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, ParseException { - 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")); } }