Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 1.31 KB

File metadata and controls

43 lines (31 loc) · 1.31 KB

embedded-elasticsearch

Maven dependency

pom.xml
<dependency>
    <groupId>com.playtika.testcontainers</groupId>
    <artifactId>embedded-elasticsearch</artifactId>
    <scope>test</scope>
</dependency>

Consumes (via bootstrap.properties)

  • embedded.elasticsearch.enabled (true|false, default is 'true')

  • embedded.elasticsearch.reuseContainer (true|false, default is 'false')

  • embedded.elasticsearch.dockerImage (default is set to 'elasticsearch:7.7.0')

  • embedded.elasticsearch.indices (indices to create, no indices are created by default)

  • embedded.elasticsearch.waitTimeoutInSeconds (default is 60 seconds)

Produces

  • embedded.elasticsearch.clusterName

  • embedded.elasticsearch.host

  • embedded.elasticsearch.httpPort

  • embedded.elasticsearch.transportPort

Example

To use auto-configured elastic client use these properties in your test application.properties:

/src/test/resources/application.properties
spring.data.elasticsearch.client.reactive.endpoints=${embedded.elasticsearch.host}:${embedded.elasticsearch.httpPort}
spring.elasticsearch.rest.uris=http://${embedded.elasticsearch.host}:${embedded.elasticsearch.httpPort}