Skip to content

Commit bffdf45

Browse files
WIP on integration tests
1 parent 3f8cde0 commit bffdf45

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/test/java/io/jenkins/plugins/opentelemetry/backend/elastic/ElasticsearchRetrieverIT.java

+13
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
import co.elastic.clients.elasticsearch.ilm.Phases;
1313
import co.elastic.clients.elasticsearch.ilm.get_lifecycle.Lifecycle;
1414
import co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient;
15+
import co.elastic.clients.elasticsearch.indices.GetIndexResponse;
1516
import co.elastic.clients.elasticsearch.indices.GetIndexTemplateResponse;
17+
import co.elastic.clients.elasticsearch.indices.IndexSettings;
18+
import co.elastic.clients.elasticsearch.indices.IndexSettingsLifecycle;
19+
import co.elastic.clients.elasticsearch.indices.IndexTemplate;
20+
import co.elastic.clients.elasticsearch.indices.get_index_template.IndexTemplateItem;
1621
import co.elastic.clients.json.jackson.JacksonJsonpMapper;
1722
import co.elastic.clients.transport.rest_client.RestClientTransport;
1823
import hudson.util.FormValidation;
@@ -35,6 +40,7 @@
3540
import java.util.ArrayList;
3641
import java.util.Collections;
3742
import java.util.List;
43+
import java.util.Optional;
3844
import java.util.Properties;
3945
import java.util.stream.Collectors;
4046

@@ -121,6 +127,13 @@ public void testGetIndexTemplate() throws IOException {
121127
ElasticsearchClient elasticsearchClient = new ElasticsearchClient(elasticsearchTransport);
122128
ElasticsearchIndicesClient elasticsearchIndicesClient = elasticsearchClient.indices();
123129
GetIndexTemplateResponse indexTemplatesResponse = elasticsearchIndicesClient.getIndexTemplate(b -> b.name("logs-apm.app"));
130+
IndexTemplate indexTemplate = indexTemplatesResponse.indexTemplates().stream().findFirst().get().indexTemplate();
131+
132+
IndexSettings indexTemplateSettings = indexTemplate.template().settings().index();
133+
134+
IndexSettingsLifecycle lifecycle = indexTemplateSettings.lifecycle();
135+
136+
System.out.println(lifecycle);
124137
// TODO the rest
125138
}
126139

0 commit comments

Comments
 (0)