Package de.juplo.httpresources
Class ConfigurableNginxContainer
- java.lang.Object
-
- org.testcontainers.containers.FailureDetectingExternalResource
-
- org.testcontainers.containers.GenericContainer<SELF>
-
- org.testcontainers.containers.NginxContainer
-
- de.juplo.httpresources.ConfigurableNginxContainer
-
- All Implemented Interfaces:
AutoCloseable
,org.junit.rules.TestRule
,org.testcontainers.containers.Container
,org.testcontainers.containers.ContainerState
,org.testcontainers.containers.traits.LinkableContainer
,org.testcontainers.containers.wait.strategy.WaitStrategyTarget
,org.testcontainers.lifecycle.Startable
public class ConfigurableNginxContainer extends org.testcontainers.containers.NginxContainer
A configurable subclass of theNginxContainer
.- Author:
- Kai Moritz
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_NGINX_PORT
-
Constructor Summary
Constructors Constructor Description ConfigurableNginxContainer()
Creates an instance with a default-configuration, that matches the static configuration of the base-classNginxContainer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configure()
Map<String,String>
getGlobalDirectives()
ConfigurableNginxContainer
withConfiguration(String path)
ConfigurableNginxContainer
withGlobalDirective(String key, String value)
Adds a global directive to the configuration-map.-
Methods inherited from class org.testcontainers.containers.NginxContainer
getBaseUrl, getLivenessCheckPorts, setCustomContent, withCustomContent
-
Methods inherited from class org.testcontainers.containers.GenericContainer
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, apply, canBeReused, containerIsCreated, containerIsStarted, containerIsStarted, containerIsStarting, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, doStart, equals, failed, fetchDockerDaemonInfo, finished, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerName, getCopyToFileContainerPathMap, getCreateContainerCmdModifiers, getDependencies, getDockerClient, getDockerDaemonInfo, getDockerImageName, getEnv, getEnvMap, getExposedPorts, getExtraHosts, getImage, getIpAddress, getLabels, getLinkedContainers, getLivenessCheckPort, getLivenessCheckPortNumbers, getLogConsumers, getNetwork, getNetworkAliases, getNetworkMode, getPortBindings, getShmSize, getStartupAttempts, getStartupCheckStrategy, getTestHostIpAddress, getTmpFsMapping, getVolumesFroms, getWaitStrategy, getWorkingDirectory, hashCode, isPrivilegedMode, isShouldBeReused, logger, setBinds, setCommand, setCommand, setCommandParts, setCopyToFileContainerPathMap, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setImage, setLabels, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setShmSize, setStartupAttempts, setStartupCheckStrategy, setTmpFsMapping, setVolumesFroms, setWaitStrategy, setWorkingDirectory, start, starting, stop, succeeded, toString, waitingFor, waitUntilContainerStarted, withClasspathResourceMapping, withClasspathResourceMapping, withCommand, withCommand, withCopyFileToContainer, withCreateContainerCmdModifier, withEnv, withEnv, withExposedPorts, withExtraHost, withFileSystemBind, withImagePullPolicy, withLabel, withLabels, withLogConsumer, withMinimumRunningDuration, withNetwork, withNetworkAliases, withNetworkMode, withPrivilegedMode, withReuse, withSharedMemorySize, withStartupAttempts, withStartupCheckStrategy, withStartupTimeout, withTmpFs, withVolumesFrom, withWorkingDirectory
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.testcontainers.containers.Container
addFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBind
-
Methods inherited from interface org.testcontainers.containers.ContainerState
copyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunning
-
-
-
-
Field Detail
-
DEFAULT_NGINX_PORT
public static final int DEFAULT_NGINX_PORT
- See Also:
- Constant Field Values
-
-
Method Detail
-
withGlobalDirective
public ConfigurableNginxContainer withGlobalDirective(String key, String value)
Adds a global directive to the configuration-map.This method can only be used to add global directives. Global directives are all directives, that are marked with the context
Main
in the {@link http://nginx.org/en/docs/ngx_core_module.html Nginx-documentation}, for exampledaemon
,user
andenv
.If you need to modify contexts, like
server
orhttp
, you have topass in a complete configuration
.- Parameters:
key
- The key of the directivevalue
- The value of the directive (the;
is added automatically)- Returns:
this
instance, to enable a fluid API.
-
withConfiguration
public ConfigurableNginxContainer withConfiguration(String path)
-
configure
protected void configure()
- Overrides:
configure
in classorg.testcontainers.containers.GenericContainer
-
-