public class AxonServerContainer extends org.testcontainers.containers.GenericContainer<AxonServerContainer>
By default, it starts in a single-node configuration.
Constructor and Description |
---|
AxonServerContainer()
Initialize an Axon Server
test container using the default image name
"axoniq/axonserver" . |
AxonServerContainer(org.testcontainers.utility.DockerImageName dockerImageName)
Initialize Axon Server with the given
dockerImageName . |
AxonServerContainer(String dockerImageName)
Initialize Axon Server with the given
dockerImageName . |
Modifier and Type | Method and Description |
---|---|
protected void |
configure() |
protected void |
doStart() |
boolean |
equals(Object o) |
String |
getAxonServerAddress()
Returns the container address in a
host:port format. |
Integer |
getGrpcPort()
Returns the mapped gRPC port used by this Axon Server container.
|
Integer |
getHttpPort()
Returns the mapped Http port used by this Axon Server container.
|
int |
hashCode() |
protected void |
optionallyCopyResourceToContainer(String pathNameInContainer,
String resourceLocation)
Map (effectively replace) a directory in Docker with the content of
resourceLocation if the resource
location is not null . |
String |
toString() |
AxonServerContainer |
withAxonServerHostname(String axonServerHostname)
Initialize this Axon Server test container with the given
axonServerHostname . |
AxonServerContainer |
withAxonServerInternalHostname(String axonServerInternalHostname)
Initialize this Axon Server test container with the given
axonServerInternalHostname . |
AxonServerContainer |
withAxonServerName(String axonServerName)
Initialize this Axon Server test container with the given
axonServerName . |
AxonServerContainer |
withClusterTemplate(String clusterTemplatePath)
Initialize this Axon Server test container with a cluster template configuration file retrieved from the given
clusterTemplatePath . |
AxonServerContainer |
withConfiguration(String configurationPath)
Initialize this Axon Server test container with a configuration file retrieved from the given
configurationPath . |
AxonServerContainer |
withDevMode(boolean devMode)
Initialize this Axon Server test container with the given
devMode . |
AxonServerContainer |
withLicense(String licensePath)
Initialize this Axon Server test container with a license file retrieved from the given
licensePath . |
protected void |
withOptionalEnv(String key,
String value)
Set an environment value if the value is present.
|
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, apply, canBeReused, containerIsCreated, containerIsStarted, containerIsStarted, containerIsStarting, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, 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, 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, starting, stop, succeeded, 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, withWorkingDirectory
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBind
copyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, execInContainerWithUser, execInContainerWithUser, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunning
public AxonServerContainer()
test container
using the default image name
"axoniq/axonserver"
.public AxonServerContainer(String dockerImageName)
dockerImageName
.dockerImageName
- The name of the Docker image to initialize this test container with.public AxonServerContainer(org.testcontainers.utility.DockerImageName dockerImageName)
dockerImageName
.dockerImageName
- The DockerImageName
to initialize this test container with.protected void configure()
configure
in class org.testcontainers.containers.GenericContainer<AxonServerContainer>
protected void doStart()
doStart
in class org.testcontainers.containers.GenericContainer<AxonServerContainer>
protected void optionallyCopyResourceToContainer(String pathNameInContainer, String resourceLocation)
resourceLocation
if the resource
location is not null
.
Protected to allow for changing implementation by extending the class.
pathNameInContainer
- The path in docker.resourceLocation
- The relative classpath to the resource.protected void withOptionalEnv(String key, String value)
Protected to allow for changing implementation by extending the class
key
- Environment value key, usually a constant.value
- Environment value to be set.public AxonServerContainer withLicense(String licensePath)
licensePath
.licensePath
- The path to the license file.public AxonServerContainer withConfiguration(String configurationPath)
configurationPath
.configurationPath
- The path to the configuration file.public AxonServerContainer withClusterTemplate(String clusterTemplatePath)
clusterTemplatePath
.clusterTemplatePath
- The path to the cluster template file.public AxonServerContainer withAxonServerName(String axonServerName)
axonServerName
.axonServerName
- The name of the Axon Server instance.public AxonServerContainer withAxonServerInternalHostname(String axonServerInternalHostname)
axonServerInternalHostname
.axonServerInternalHostname
- The internal hostname of the Axon Server instance.public AxonServerContainer withAxonServerHostname(String axonServerHostname)
axonServerHostname
.axonServerHostname
- The hostname of the Axon Server instance.public AxonServerContainer withDevMode(boolean devMode)
devMode
.
Development mode enables some features for development convenience. Default value is false
.
devMode
- A boolean
dictating whether to enable development mode, yes or no.public Integer getHttpPort()
public Integer getGrpcPort()
public String getAxonServerAddress()
host:port
format.host:port
format.public boolean equals(Object o)
equals
in class org.testcontainers.containers.GenericContainer<AxonServerContainer>
public int hashCode()
hashCode
in class org.testcontainers.containers.GenericContainer<AxonServerContainer>
public String toString()
toString
in class org.testcontainers.containers.GenericContainer<AxonServerContainer>
Copyright © 2010–2024. All rights reserved.