Skip to content

Commit

Permalink
[Backport 2.x] Fixed testPluginInstalled failure (#92) (#93)
Browse files Browse the repository at this point in the history
Fixed testPluginInstalled failure (#92)

(cherry picked from commit 1b856de)
Signed-off-by: Owais Kazi <[email protected]>
  • Loading branch information
owaiskazi19 committed Oct 14, 2023
1 parent 922d36c commit 8c37b2d
Showing 1 changed file with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Class<? extends Plugin>> 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"));
}
}

0 comments on commit 8c37b2d

Please sign in to comment.