public class HiveMQContainer extends org.testcontainers.containers.GenericContainer<HiveMQContainer>
Supported images: hivemq/hivemq4, hivemq/hivemq-ce
Exposed ports:
| Constructor and Description |
|---|
HiveMQContainer(@NotNull org.testcontainers.utility.DockerImageName dockerImageName) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configure() |
protected void |
containerIsStarted(@NotNull com.github.dockerjava.api.command.InspectContainerResponse containerInfo) |
void |
disableExtension(@NotNull HiveMQExtension hiveMQExtension)
Disables the extension.
|
void |
disableExtension(@NotNull HiveMQExtension hiveMQExtension,
@NotNull java.time.Duration timeout)
Disables the extension.
|
void |
disableExtension(@NotNull java.lang.String extensionName,
@NotNull java.lang.String extensionDirectory)
Disables the extension with the given name and extension directory name.
|
void |
disableExtension(@NotNull java.lang.String extensionName,
@NotNull java.lang.String extensionDirectory,
@NotNull java.time.Duration timeout)
Disables the extension with the given name and extension directory name.
|
void |
enableExtension(@NotNull HiveMQExtension hiveMQExtension)
Enables the extension.
|
void |
enableExtension(@NotNull HiveMQExtension hiveMQExtension,
@NotNull java.time.Duration timeout)
Enables the extension.
|
void |
enableExtension(@NotNull java.lang.String extensionName,
@NotNull java.lang.String extensionDirectory)
Enables the extension with the given name and extension directory name.
|
void |
enableExtension(@NotNull java.lang.String extensionName,
@NotNull java.lang.String extensionDirectory,
@NotNull java.time.Duration timeout)
Enables the extension with the given name and extension directory name.
|
int |
getMqttPort()
Get the mapped port for the MQTT port of the container.
|
@NotNull HiveMQContainer |
waitForExtension(@NotNull HiveMQExtension extension)
Adds a wait condition for this
HiveMQExtension |
@NotNull HiveMQContainer |
waitForExtension(@NotNull java.lang.String extensionName)
Adds a wait condition for the extension with this name.
|
@NotNull HiveMQContainer |
withControlCenter()
Enables connection to the HiveMQ Control Center on host port 8080.
|
@NotNull HiveMQContainer |
withDebugging()
Enables the possibility for remote debugging clients to connect.
|
@NotNull HiveMQContainer |
withExtension(@NotNull HiveMQExtension hiveMQExtension)
Wraps the given class and all its subclasses into an extension
and puts it into '/opt/hivemq/temp-extensions/{extension-id}' inside the container.
|
@NotNull HiveMQContainer |
withExtension(@NotNull org.testcontainers.utility.MountableFile mountableExtension)
Puts the given extension folder into '/opt/hivemq/temp-extensions/{directory-name}' inside the container.
|
@NotNull HiveMQContainer |
withFileInExtensionHomeFolder(@NotNull org.testcontainers.utility.MountableFile file,
@NotNull java.lang.String extensionId)
Puts the given file into the root of the extension's home '/opt/hivemq/temp-extensions/{extensionId}/'.
|
@NotNull HiveMQContainer |
withFileInExtensionHomeFolder(@NotNull org.testcontainers.utility.MountableFile file,
@NotNull java.lang.String extensionId,
@NotNull java.lang.String pathInExtensionHome)
Puts the given file into given subdirectory of the extensions's home '/opt/hivemq/temp-extensions/{id}/{pathInExtensionHome}/'
|
@NotNull HiveMQContainer |
withFileInHomeFolder(@NotNull org.testcontainers.utility.MountableFile mountableFile,
@NotNull java.lang.String pathInHomeFolder)
Puts the given file into the given subdirectory of the HiveMQ home folder '/opt/hivemq/{pathInHomeFolder}'.
|
@NotNull HiveMQContainer |
withHiveMQConfig(@NotNull org.testcontainers.utility.MountableFile mountableConfig)
Overwrites the HiveMQ configuration in '/opt/hivemq/conf/' inside the container.
|
@NotNull HiveMQContainer |
withLicense(@NotNull org.testcontainers.utility.MountableFile mountableLicense)
Puts the given license into '/opt/hivemq/license/' inside the container.
|
@NotNull HiveMQContainer |
withLogLevel(@NotNull org.slf4j.event.Level level)
Sets the logging
Level inside the container. |
@NotNull HiveMQContainer |
withoutPrepackagedExtensions()
Removes all prepackaged extension folders from '/opt/hivemq/extensions' before the container is started.
|
@NotNull HiveMQContainer |
withoutPrepackagedExtensions(java.lang.String... extensionIds)
Removes the specified prepackaged extension folders from '/opt/hivemq/extensions' before the container is started.
|
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, apply, canBeReused, 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, 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, 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, execInContainerWithUser, execInContainerWithUser, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunningpublic HiveMQContainer(@NotNull
@NotNull org.testcontainers.utility.DockerImageName dockerImageName)
protected void configure()
configure in class org.testcontainers.containers.GenericContainer<HiveMQContainer>protected void containerIsStarted(@NotNull
@NotNull com.github.dockerjava.api.command.InspectContainerResponse containerInfo)
containerIsStarted in class org.testcontainers.containers.GenericContainer<HiveMQContainer>@NotNull public @NotNull HiveMQContainer waitForExtension(@NotNull @NotNull java.lang.String extensionName)
Must be called before the container is started.
extensionName - the extension to wait for@NotNull public @NotNull HiveMQContainer waitForExtension(@NotNull @NotNull HiveMQExtension extension)
HiveMQExtension
Must be called before the container is started.
extension - the extension to wait for@NotNull public @NotNull HiveMQContainer withDebugging()
Must be called before the container is started.
@NotNull public @NotNull HiveMQContainer withLogLevel(@NotNull @NotNull org.slf4j.event.Level level)
Level inside the container.
Must be called before the container is started.
level - the Level@NotNull public @NotNull HiveMQContainer withExtension(@NotNull @NotNull HiveMQExtension hiveMQExtension)
Must be called before the container is started.
The contents of the '/opt/hivemq/temp-extensions/' directory are copied to '/opt/hivemq/extensions/' before the container is started.
hiveMQExtension - the HiveMQExtension of the extension@NotNull public @NotNull HiveMQContainer withExtension(@NotNull @NotNull org.testcontainers.utility.MountableFile mountableExtension)
Must be called before the container is started.
The contents of the '/opt/hivemq/temp-extensions/' directory are copied to '/opt/hivemq/extensions/' before the container is started.
mountableExtension - the extension folder on the host machine@NotNull public @NotNull HiveMQContainer withoutPrepackagedExtensions(@NotNull java.lang.String... extensionIds)
Must be called before the container is started.
extensionIds - the prepackaged extensions to remove@NotNull public @NotNull HiveMQContainer withoutPrepackagedExtensions()
Must be called before the container is started.
@NotNull public @NotNull HiveMQContainer withLicense(@NotNull @NotNull org.testcontainers.utility.MountableFile mountableLicense)
Must be called before the container is started.
mountableLicense - the license file on the host machine@NotNull public @NotNull HiveMQContainer withHiveMQConfig(@NotNull @NotNull org.testcontainers.utility.MountableFile mountableConfig)
Must be called before the container is started.
mountableConfig - the config file on the host machine@NotNull public @NotNull HiveMQContainer withFileInExtensionHomeFolder(@NotNull @NotNull org.testcontainers.utility.MountableFile file, @NotNull @NotNull java.lang.String extensionId)
Must be called before the container is started.
The contents of the '/opt/hivemq/temp-extensions/' directory are copied to '/opt/hivemq/extensions/' before the container is started.
file - the file on the host machineextensionId - the extension@NotNull public @NotNull HiveMQContainer withFileInExtensionHomeFolder(@NotNull @NotNull org.testcontainers.utility.MountableFile file, @NotNull @NotNull java.lang.String extensionId, @NotNull @NotNull java.lang.String pathInExtensionHome)
Must be called before the container is started.
The contents of the '/opt/hivemq/temp-extensions/' directory are copied to '/opt/hivemq/extensions/' before the container is started.
file - the file on the host machineextensionId - the extensionpathInExtensionHome - the path@NotNull public @NotNull HiveMQContainer withFileInHomeFolder(@NotNull @NotNull org.testcontainers.utility.MountableFile mountableFile, @NotNull @NotNull java.lang.String pathInHomeFolder)
Must be called before the container is started.
mountableFile - the file on the host machinepathInHomeFolder - the pathpublic void disableExtension(@NotNull
@NotNull java.lang.String extensionName,
@NotNull
@NotNull java.lang.String extensionDirectory,
@NotNull
@NotNull java.time.Duration timeout)
throws java.util.concurrent.TimeoutException
This can only be called once the container is started.
extensionName - the name of the extension to disableextensionDirectory - the name of the extension's directorytimeout - the timeoutjava.util.concurrent.TimeoutException - if the extension was not disabled within the configured timeoutpublic void disableExtension(@NotNull
@NotNull java.lang.String extensionName,
@NotNull
@NotNull java.lang.String extensionDirectory)
throws java.util.concurrent.TimeoutException
This can only be called once the container is started.
extensionName - the name of the extension to disableextensionDirectory - the name of the extension's directoryjava.util.concurrent.TimeoutException - if the extension was not disabled within 60 secondspublic void disableExtension(@NotNull
@NotNull HiveMQExtension hiveMQExtension,
@NotNull
@NotNull java.time.Duration timeout)
throws java.util.concurrent.TimeoutException
This can only be called once the container is started.
hiveMQExtension - the extensiontimeout - the timeoutjava.util.concurrent.TimeoutException - if the extension was not disabled within the configured timeoutpublic void disableExtension(@NotNull
@NotNull HiveMQExtension hiveMQExtension)
throws java.util.concurrent.TimeoutException
This can only be called once the container is started.
hiveMQExtension - the extensionjava.util.concurrent.TimeoutException - if the extension was not disabled within 60 secondspublic void enableExtension(@NotNull
@NotNull java.lang.String extensionName,
@NotNull
@NotNull java.lang.String extensionDirectory,
@NotNull
@NotNull java.time.Duration timeout)
throws java.util.concurrent.TimeoutException
This can only be called once the container is started.
extensionName - the name of the extension to disableextensionDirectory - the name of the extension's directorytimeout - the timeoutjava.util.concurrent.TimeoutException - if the extension was not enabled within the configured timeoutpublic void enableExtension(@NotNull
@NotNull java.lang.String extensionName,
@NotNull
@NotNull java.lang.String extensionDirectory)
throws java.util.concurrent.TimeoutException
This can only be called once the container is started.
extensionName - the name of the extension to disableextensionDirectory - the name of the extension's directoryjava.util.concurrent.TimeoutException - if the extension was not enabled within 60 secondspublic void enableExtension(@NotNull
@NotNull HiveMQExtension hiveMQExtension,
@NotNull
@NotNull java.time.Duration timeout)
throws java.util.concurrent.TimeoutException
This can only be called once the container is started.
hiveMQExtension - the extensiontimeout - the timeoutjava.util.concurrent.TimeoutException - if the extension was not enabled within the configured timeoutpublic void enableExtension(@NotNull
@NotNull HiveMQExtension hiveMQExtension)
throws java.util.concurrent.TimeoutException
This can only be called once the container is started.
hiveMQExtension - the extensionjava.util.concurrent.TimeoutException - if the extension was not enabled within 60 seconds@NotNull public @NotNull HiveMQContainer withControlCenter()
Must be called before the container is started.
public int getMqttPort()
Must be called after the container is started.