mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-05-31 09:12:11 +00:00
DATAES-782 - Make underlying TransportClient accessible.
Original PR: #421
This commit is contained in:
parent
e449944e3b
commit
3afd6fd427
@ -343,5 +343,9 @@ public class ElasticsearchTemplate extends AbstractElasticsearchTemplate {
|
||||
} catch (Exception ignored) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Client getClient() {
|
||||
return client;
|
||||
}
|
||||
// endregion
|
||||
}
|
||||
|
@ -131,6 +131,13 @@ public class ElasticsearchTransportTemplateTests extends ElasticsearchTemplateTe
|
||||
assertThat(fetchSourceContext.excludes()).containsExactlyInAnyOrder("excl");
|
||||
}
|
||||
|
||||
@Test // DATAES-782
|
||||
void shouldProvideClient() {
|
||||
Client client = ((ElasticsearchTemplate) operations).getClient();
|
||||
|
||||
assertThat(client).isNotNull();
|
||||
}
|
||||
|
||||
@Data
|
||||
@Document(indexName = "test-index-sample-core-transport-template", replicas = 0, refreshInterval = "-1")
|
||||
static class SampleEntity {
|
||||
|
Loading…
x
Reference in New Issue
Block a user