Skip to content

Latest commit

 

History

History
70 lines (49 loc) · 2.41 KB

influxdb.md

File metadata and controls

70 lines (49 loc) · 2.41 KB

InfluxDB Module

Testcontainers module for InfluxData InfluxDB.

Important Note

They are breaking changes in InfluxDB v2.x. For more information refer to the main documentation. InfluxDB official container registry on docker hub.

InfluxDB V2.x Usage example

Running influxDbContainer as a stand-in for InfluxDB in a test:

InfluxDBContainerV2Test

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.

InfluxDB V1.x Usage example (Deprecated)

Running influxDbContainer as a stand-in for InfluxDB in a test:

InfluxDBContainerV1Test

Adding this module to your project dependencies

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.