Package org.testcontainers.couchbase
Class CouchbaseContainer
java.lang.Object
org.testcontainers.containers.GenericContainer<CouchbaseContainer>
org.testcontainers.couchbase.CouchbaseContainer
- All Implemented Interfaces:
AutoCloseable,org.testcontainers.containers.Container<CouchbaseContainer>,org.testcontainers.containers.ContainerState,org.testcontainers.containers.traits.LinkableContainer,org.testcontainers.containers.wait.strategy.WaitStrategyTarget,org.testcontainers.lifecycle.Startable
public class CouchbaseContainer
extends org.testcontainers.containers.GenericContainer<CouchbaseContainer>
Testcontainers implementation for Couchbase.
Supported image: couchbase/server
Exposed ports:
- Console: 8091
Note that it does not depend on a specific couchbase SDK, so it can be used with both the Java SDK 2 and 3 as well as the Scala SDK 1 or newer. We recommend using the latest and greatest SDKs for the best experience.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.testcontainers.containers.Container
org.testcontainers.containers.Container.ExecResult -
Field Summary
Fields 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
ConstructorsConstructorDescriptionCouchbaseContainer(String dockerImageName) Creates a new couchbase container with the specified image name.CouchbaseContainer(org.testcontainers.utility.DockerImageName dockerImageName) Create a new couchbase container with the specified image name. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidcontainerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) protected voidcontainerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo, boolean reused) protected voidcontainerIsStarting(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) protected voidcontainerIsStarting(com.github.dockerjava.api.command.InspectContainerResponse containerInfo, boolean reused) intintfinal Stringfinal StringEnables the analytics service which is not enabled by default.withBucket(BucketDefinition bucketDefinition) withCredentials(String username, String password) Set custom username and password for the admin user.withEnabledServices(CouchbaseService... enabled) Enables the eventing service which is not enabled by default.withServiceQuota(CouchbaseService service, int quotaMb) Configures a custom memory quota for a given service.Methods inherited from class org.testcontainers.containers.GenericContainer
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, canBeReused, containerIsCreated, 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, getLivenessCheckPortNumbers, 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
-
Constructor Details
-
CouchbaseContainer
Creates a new couchbase container with the specified image name.- Parameters:
dockerImageName- the image name that should be used.
-
CouchbaseContainer
public CouchbaseContainer(org.testcontainers.utility.DockerImageName dockerImageName) Create a new couchbase container with the specified image name.- Parameters:
dockerImageName- the image name that should be used.
-
-
Method Details
-
withCredentials
Set custom username and password for the admin user.- Parameters:
username- the admin username to use.password- the password for the admin user.- Returns:
- this
CouchbaseContainerfor chaining purposes.
-
withBucket
-
withEnabledServices
-
withServiceQuota
Configures a custom memory quota for a given service.- Parameters:
service- the service to configure the quota for.quotaMb- the memory quota in MB.- Returns:
- this
CouchbaseContainerfor chaining purposes.
-
withAnalyticsService
Enables the analytics service which is not enabled by default.- Returns:
- this
CouchbaseContainerfor chaining purposes.
-
withEventingService
Enables the eventing service which is not enabled by default.- Returns:
- this
CouchbaseContainerfor chaining purposes.
-
getUsername
-
getPassword
-
getBootstrapCarrierDirectPort
public int getBootstrapCarrierDirectPort() -
getBootstrapHttpDirectPort
public int getBootstrapHttpDirectPort() -
getConnectionString
-
configure
protected void configure()- Overrides:
configurein classorg.testcontainers.containers.GenericContainer<CouchbaseContainer>
-
containerIsStarting
protected void containerIsStarting(com.github.dockerjava.api.command.InspectContainerResponse containerInfo, boolean reused) - Overrides:
containerIsStartingin classorg.testcontainers.containers.GenericContainer<CouchbaseContainer>
-
containerIsStarting
protected void containerIsStarting(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) - Overrides:
containerIsStartingin classorg.testcontainers.containers.GenericContainer<CouchbaseContainer>
-
containerIsStarted
protected void containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo, boolean reused) - Overrides:
containerIsStartedin classorg.testcontainers.containers.GenericContainer<CouchbaseContainer>
-
containerIsStarted
protected void containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) - Overrides:
containerIsStartedin classorg.testcontainers.containers.GenericContainer<CouchbaseContainer>
-