springboot-testcontainer-elasticsearch

Elasticsearch test-container

License

License

Categories

Categories

IDE Development Tools Container Search Business Logic Libraries Elasticsearch
GroupId

GroupId

com.avides.springboot.testcontainer
ArtifactId

ArtifactId

springboot-testcontainer-elasticsearch
Last Version

Last Version

1.0.0-RC2
Release Date

Release Date

Type

Type

jar
Description

Description

springboot-testcontainer-elasticsearch
Elasticsearch test-container
Project URL

Project URL

https://github.com/springboot-testcontainer/springboot-testcontainer-elasticsearch
Source Code Management

Source Code Management

https://github.com/springboot-testcontainer/springboot-testcontainer-elasticsearch

Download springboot-testcontainer-elasticsearch

How to add to project

<!-- https://jarcasting.com/artifacts/com.avides.springboot.testcontainer/springboot-testcontainer-elasticsearch/ -->
<dependency>
    <groupId>com.avides.springboot.testcontainer</groupId>
    <artifactId>springboot-testcontainer-elasticsearch</artifactId>
    <version>1.0.0-RC2</version>
</dependency>
// https://jarcasting.com/artifacts/com.avides.springboot.testcontainer/springboot-testcontainer-elasticsearch/
implementation 'com.avides.springboot.testcontainer:springboot-testcontainer-elasticsearch:1.0.0-RC2'
// https://jarcasting.com/artifacts/com.avides.springboot.testcontainer/springboot-testcontainer-elasticsearch/
implementation ("com.avides.springboot.testcontainer:springboot-testcontainer-elasticsearch:1.0.0-RC2")
'com.avides.springboot.testcontainer:springboot-testcontainer-elasticsearch:jar:1.0.0-RC2'
<dependency org="com.avides.springboot.testcontainer" name="springboot-testcontainer-elasticsearch" rev="1.0.0-RC2">
  <artifact name="springboot-testcontainer-elasticsearch" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.avides.springboot.testcontainer', module='springboot-testcontainer-elasticsearch', version='1.0.0-RC2')
)
libraryDependencies += "com.avides.springboot.testcontainer" % "springboot-testcontainer-elasticsearch" % "1.0.0-RC2"
[com.avides.springboot.testcontainer/springboot-testcontainer-elasticsearch "1.0.0-RC2"]

Dependencies

compile (1)

Group / Artifact Type Version
com.avides.springboot.testcontainer : springboot-testcontainer-common jar 1.0.0-RC2

provided (3)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.18.10
org.springframework.boot : spring-boot-autoconfigure jar 2.2.1.RELEASE
org.springframework.data : spring-data-elasticsearch jar 3.2.2.RELEASE

test (8)

Group / Artifact Type Version
org.assertj : assertj-core jar 3.14.0
org.easymock : easymock jar 4.1
org.powermock : powermock-module-junit4 jar 2.0.4
org.powermock : powermock-api-easymock jar 2.0.4
org.jacoco : org.jacoco.agent jar 0.8.5
org.springframework : spring-test jar 5.2.1.RELEASE
org.springframework.boot : spring-boot-test jar 2.2.1.RELEASE
ch.qos.logback : logback-classic jar 1.2.3

Project Modules

There are no modules declared in this project.

springtainer-elasticsearch

Maven Central Build Nightly build Coverage report Quality Gate Technical dept

Dependency

<dependency>
	<groupId>com.avides.springboot.springtainer</groupId>
	<artifactId>springtainer-elasticsearch</artifactId>
	<version>1.2.1</version>
	<scope>test</scope>
</dependency>

Configuration

Properties consumed (in bootstrap.properties):

  • embedded.container.elasticsearch.enabled (default is true)
  • embedded.container.elasticsearch.startup-timeout (default is 30)
  • embedded.container.elasticsearch.docker-image (default is docker.elastic.co/elasticsearch/elasticsearch:7.6.2)
  • embedded.container.elasticsearch.http-port (default is 9200)
  • embedded.container.elasticsearch.transport-host (default is 9300)

Properties provided (in application-it.properties):

  • embedded.container.elasticsearch.host
  • embedded.container.elasticsearch.http-port
  • embedded.container.elasticsearch.transport-port

Example for minimal configuration in application-it.properties:

spring.data.elasticsearch.cluster-nodes=${embedded.container.elasticsearch.host}:${embedded.container.elasticsearch.transport-port}
spring.data.elasticsearch.properties.client.transport.ignore_cluster_name=true

Logging

To reduce logging insert this into the logback-configuration:

<!-- Springtainer -->
<logger name="com.github.dockerjava.jaxrs" level="WARN" />
<logger name="com.github.dockerjava.core.command" level="WARN" />
<logger name="org.apache.http" level="WARN" />

Labels

The container exports multiple labels to analyze running springtainers:

  • SPRINGTAINER_SERVICE=elasticsearch
  • SPRINGTAINER_IMAGE=${embedded.container.elasticsearch.docker-image}
  • SPRINGTAINER_STARTED=$currentTimestamp

Versions

Version
1.0.0-RC2
1.0.0-RC1
0.1.0-RC12
0.1.0-RC11
0.1.0-RC10
0.1.0-RC9
0.1.0-RC8
0.1.0-RC7
0.1.0-RC6
0.1.0-RC5
0.1.0-RC4
0.1.0-RC3
0.1.0-RC2
0.1.0-RC1