Skip to content

Commit

Permalink
Fixed testPluginInstalled failure (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
owaiskazi19 committed Oct 13, 2023
1 parent b1fbe0b commit 1b856de
Showing 1 changed file with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Class<? extends Plugin>> 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"));
}
}

0 comments on commit 1b856de

Please sign in to comment.