Testcontainers module for InfluxData InfluxDB.
They are breaking changes in InfluxDB v2.x. For more information refer to the main documentation. InfluxDB official container registry on docker hub.
Running influxDbContainer as a stand-in for InfluxDB in a test:
The influxDB will be setup with the following data:
Property | Default Value |
---|---|
username | test-user |
password | test-password |
organization | test-org |
bucket | test-bucket |
retention | 0 (infinite) |
adminToken | - |
For more details about the InfluxDB setup go to the official docs .
It is possible to override the default values, take a look at these tests:
InfluxDBContainerV2WithUserTest
NOTE: You can find the latest documentation about the influxdb v2.x java client here.
Running influxDbContainer as a stand-in for InfluxDB in a test:
Add the following dependency to your pom.xml
/build.gradle
file:
testImplementation "org.testcontainers:influxdb:{{latest_version}}"
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>influxdb</artifactId>
<version>{{latest_version}}</version>
<scope>test</scope>
</dependency>
!!! hint Adding this Testcontainers library JAR will not automatically add a database driver JAR to your project. You should ensure that your project also has a suitable database driver as a dependency.