Skip to content

Commit

Permalink
Add MainRestPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
y-fujita authored and y-fujita committed Nov 12, 2023
1 parent b9be910 commit 2ac50d0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@
<artifactId>transport-netty4</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<dependency>
<groupId>org.codelibs.elasticsearch.module</groupId>
<artifactId>rest-root</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<dependency>
<groupId>args4j</groupId>
<artifactId>args4j</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public class ElasticsearchClusterRunner implements Closeable {
// "org.elasticsearch.repositories.azure.AzureRepositoryPlugin", //
"org.elasticsearch.repositories.gcs.GoogleCloudStoragePlugin", //
"org.elasticsearch.repositories.s3.S3RepositoryPlugin", //
"org.elasticsearch.rest.root.MainRestPlugin", //
"org.elasticsearch.plugin.repository.url.URLRepositoryPlugin", //
"org.elasticsearch.runtimefields.RuntimeFieldsCommonPlugin", //
"org.elasticsearch.transport.netty4.Netty4Plugin", //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,17 @@ public void test_runCluster() throws Exception {
final Node node = runner.node();

// http access
// root
try (CurlResponse curlResponse =
EcrCurl.get(node, "/").execute()) {
final String content = curlResponse.getContentAsString();
assertNotNull(content);
assertTrue(content.contains("cluster_name"));
final Map<String, Object> map = curlResponse.getContent(EcrCurl.jsonParser());
assertNotNull(map);
assertEquals(clusterName, map.get("cluster_name").toString());
}

// get
try (CurlResponse curlResponse =
EcrCurl.get(node, "/_search").header("Content-Type", "application/json").param("q", "*:*").execute()) {
Expand Down

0 comments on commit 2ac50d0

Please sign in to comment.