Package org.testcontainers.containers
Class InfluxDBContainer<SELF extends InfluxDBContainer<SELF>>
java.lang.Object
org.testcontainers.containers.GenericContainer<SELF>
org.testcontainers.containers.InfluxDBContainer<SELF>
- All Implemented Interfaces:
AutoCloseable,org.testcontainers.containers.Container<SELF>,org.testcontainers.containers.ContainerState,org.testcontainers.containers.traits.LinkableContainer,org.testcontainers.containers.wait.strategy.WaitStrategyTarget,org.testcontainers.lifecycle.Startable
public class InfluxDBContainer<SELF extends InfluxDBContainer<SELF>>
extends org.testcontainers.containers.GenericContainer<SELF>
Testcontainers implementation for InfluxDB.
Supported image: influxdb
Exposed ports: 8086
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.testcontainers.containers.Container
org.testcontainers.containers.Container.ExecResult -
Field Summary
FieldsFields inherited from class org.testcontainers.containers.GenericContainer
CONTAINER_RUNNING_TIMEOUT_SEC, dependencies, dockerClient, INTERNAL_HOST_HOSTNAME, waitStrategyFields inherited from interface org.testcontainers.containers.ContainerState
STATE_HEALTHY -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.InfluxDBContainer(String version) Deprecated.useInfluxDBContainer(DockerImageName)insteadInfluxDBContainer(org.testcontainers.utility.DockerImageName dockerImageName) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidSets the InfluxDB environment variables based on the versionProperties of InfluxDB 2.xorg.influxdb.InfluxDBDeprecated.Use the new InfluxDB client library.getUrl()Sets the admin userwithAdminPassword(String adminPassword) Sets the admin passwordwithAdminToken(String adminToken) Sets the admin tokenwithAuthEnabled(boolean authEnabled) Determines if authentication should be enabled or notwithBucket(String bucket) Initializes bucket with given namewithDatabase(String database) Initializes database with given namewithOrganization(String organization) Sets the organization namewithPassword(String password) Set password for InfluxDBwithRetention(String retention) Sets the retention in dayswithUsername(String username) Set user for InfluxDBMethods inherited from class org.testcontainers.containers.GenericContainer
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, canBeReused, containerIsCreated, containerIsStarted, containerIsStarted, containerIsStarting, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, doStart, equals, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerName, getCopyToFileContainerPathMap, getCreateContainerCmdModifiers, getDependencies, getDockerClient, getDockerImageName, getEnv, getEnvMap, getExposedPorts, getExtraHosts, getImage, getIpAddress, getLabels, getLinkedContainers, getLivenessCheckPort, getLivenessCheckPorts, getLogConsumers, getNetwork, getNetworkAliases, getNetworkMode, getPortBindings, getShmSize, getStartupAttempts, getStartupCheckStrategy, getTestHostIpAddress, getTmpFsMapping, getVolumesFroms, getWaitStrategy, getWorkingDirectory, hashCode, isHostAccessible, isPrivilegedMode, isShouldBeReused, logger, setBinds, setCommand, setCommand, setCommandParts, setContainerDef, setCopyToFileContainerPathMap, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setHostAccessible, setImage, setLabels, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setShmSize, setStartupAttempts, setStartupCheckStrategy, setTmpFsMapping, setVolumesFroms, setWaitStrategy, setWorkingDirectory, start, stop, toString, waitingFor, waitUntilContainerStarted, withAccessToHost, withClasspathResourceMapping, withClasspathResourceMapping, withCommand, withCommand, withCopyFileToContainer, withCopyToContainer, withCreateContainerCmdModifier, withEnv, withEnv, withExposedPorts, withExtraHost, withFileSystemBind, withImagePullPolicy, withLabel, withLabels, withLogConsumer, withMinimumRunningDuration, withNetwork, withNetworkAliases, withNetworkMode, withPrivilegedMode, withReuse, withSharedMemorySize, withStartupAttempts, withStartupCheckStrategy, withStartupTimeout, withTmpFs, withVolumesFrom, withWorkingDirectoryMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.testcontainers.containers.Container
addFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBindMethods inherited from interface org.testcontainers.containers.ContainerState
copyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, execInContainer, execInContainer, execInContainerWithUser, execInContainerWithUser, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunningMethods inherited from interface org.testcontainers.lifecycle.Startable
close
-
Field Details
-
INFLUXDB_PORT
-
VERSION
Deprecated.- See Also:
-
-
Constructor Details
-
InfluxDBContainer
Deprecated.useInfluxDBContainer(DockerImageName)instead -
InfluxDBContainer
Deprecated.useInfluxDBContainer(DockerImageName)instead -
InfluxDBContainer
public InfluxDBContainer(org.testcontainers.utility.DockerImageName dockerImageName)
-
-
Method Details
-
configure
protected void configure()Sets the InfluxDB environment variables based on the version- Overrides:
configurein classorg.testcontainers.containers.GenericContainer<SELF extends InfluxDBContainer<SELF>>
-
getLivenessCheckPortNumbers
- Specified by:
getLivenessCheckPortNumbersin interfaceorg.testcontainers.containers.wait.strategy.WaitStrategyTarget- Overrides:
getLivenessCheckPortNumbersin classorg.testcontainers.containers.GenericContainer<SELF extends InfluxDBContainer<SELF>>
-
withUsername
Set user for InfluxDB- Parameters:
username- The username to set for the system's initial super-user- Returns:
- a reference to this container instance
-
withPassword
Set password for InfluxDB- Parameters:
password- The password to set for the system's initial super-user- Returns:
- a reference to this container instance
-
withAuthEnabled
Determines if authentication should be enabled or not- Parameters:
authEnabled- Enables authentication.- Returns:
- a reference to this container instance
-
withAdmin
Sets the admin user- Parameters:
admin- The name of the admin user to be created. If this is unset, no admin user is created.- Returns:
- a reference to this container instance
-
withAdminPassword
Sets the admin password- Parameters:
adminPassword- The password for the admin user. If this is unset, a random password is generated and printed to standard out.- Returns:
- a reference to this container instance
-
withDatabase
Initializes database with given name- Parameters:
database- name of the database.- Returns:
- a reference to this container instance
-
withOrganization
Sets the organization name- Parameters:
organization- The organization for the initial setup of influxDB.- Returns:
- a reference to this container instance
-
withBucket
Initializes bucket with given name- Parameters:
bucket- name of the bucket.- Returns:
- a reference to this container instance
-
withRetention
Sets the retention in days- Parameters:
retention- days bucket will retain data (0 is infinite, default is 0).- Returns:
- a reference to this container instance
-
withAdminToken
Sets the admin token- Parameters:
adminToken- Authentication token to associate with the admin user.- Returns:
- a reference to this container instance
-
getUrl
- Returns:
- a url to InfluxDB
-
getNewInfluxDB
Deprecated.Use the new InfluxDB client library.- Returns:
- a InfluxDB client for InfluxDB 1.x.
-
getUsername
-
getPassword
-
getDatabase
-
getBucket
Properties of InfluxDB 2.x -
getOrganization
-
getRetention
-
getAdminToken
-
InfluxDBContainer(DockerImageName)instead