public class ElasticsearchContainer extends org.testcontainers.containers.GenericContainer<ElasticsearchContainer>
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
DEFAULT_TAG
Deprecated.
|
static java.lang.String |
ELASTICSEARCH_DEFAULT_PASSWORD
Elasticsearch Default Password for Elasticsearch >= 8
|
| Constructor and Description |
|---|
ElasticsearchContainer()
Deprecated.
use
ElasticsearchContainer(DockerImageName) instead |
ElasticsearchContainer(org.testcontainers.utility.DockerImageName dockerImageName)
Create an Elasticsearch Container by passing the full docker image name
|
ElasticsearchContainer(java.lang.String dockerImageName)
Create an Elasticsearch Container by passing the full docker image name
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Optional<byte[]> |
caCertAsBytes()
If this is running above Elasticsearch 8, this will return the probably self-signed CA cert that has been extracted
|
protected void |
containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) |
javax.net.ssl.SSLContext |
createSslContextFromCa()
A SSL context based on the self signed CA, so that using this SSL Context allows to connect to the Elasticsearch service
|
java.lang.String |
getHttpHostAddress() |
java.net.InetSocketAddress |
getTcpHost()
Deprecated.
|
ElasticsearchContainer |
withCertPath(java.lang.String certPath)
Configure a CA cert path that is not the default
|
ElasticsearchContainer |
withPassword(java.lang.String password)
Define the Elasticsearch password to set.
|
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, apply, canBeReused, configure, containerIsCreated, containerIsStarted, containerIsStarting, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, doStart, equals, failed, finished, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerName, getCopyToFileContainerPathMap, getCreateContainerCmdModifiers, getDependencies, getDockerClient, getDockerImageName, getEnv, getEnvMap, getExposedPorts, getExtraHosts, getImage, getIpAddress, getLabels, getLinkedContainers, getLivenessCheckPort, getLivenessCheckPortNumbers, getLivenessCheckPorts, getLogConsumers, getNetwork, getNetworkAliases, getNetworkMode, getPortBindings, getShmSize, getStartupAttempts, getStartupCheckStrategy, getTestHostIpAddress, getTmpFsMapping, getVolumesFroms, getWaitStrategy, getWorkingDirectory, hashCode, isHostAccessible, isPrivilegedMode, isShouldBeReused, logger, setBinds, setCommand, setCommand, setCommandParts, setCopyToFileContainerPathMap, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setHostAccessible, setImage, setLabels, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setShmSize, setStartupAttempts, setStartupCheckStrategy, setTmpFsMapping, setVolumesFroms, setWaitStrategy, setWorkingDirectory, start, starting, stop, succeeded, 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, withWorkingDirectoryclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBindcopyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunningpublic static final java.lang.String ELASTICSEARCH_DEFAULT_PASSWORD
@Deprecated protected static final java.lang.String DEFAULT_TAG
@Deprecated public ElasticsearchContainer()
ElasticsearchContainer(DockerImageName) insteadpublic ElasticsearchContainer(java.lang.String dockerImageName)
dockerImageName - Full docker image name as a String, like: docker.elastic.co/elasticsearch/elasticsearch:7.9.2public ElasticsearchContainer(org.testcontainers.utility.DockerImageName dockerImageName)
dockerImageName - Full docker image name as a DockerImageName, like: DockerImageName.parse("docker.elastic.co/elasticsearch/elasticsearch:7.9.2")protected void containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo)
containerIsStarted in class org.testcontainers.containers.GenericContainer<ElasticsearchContainer>public java.util.Optional<byte[]> caCertAsBytes()
public javax.net.ssl.SSLContext createSslContextFromCa()
public ElasticsearchContainer withPassword(java.lang.String password)
password - Password to setpublic ElasticsearchContainer withCertPath(java.lang.String certPath)
certPath - Path to the CA certificate within the Docker container to extract it from after start uppublic java.lang.String getHttpHostAddress()
@Deprecated public java.net.InetSocketAddress getTcpHost()