Package net.officefloor.docker.test
Class OfficeFloorDockerUtil
- java.lang.Object
-
- net.officefloor.docker.test.OfficeFloorDockerUtil
-
public class OfficeFloorDockerUtil extends java.lang.Object
Docker wrapper for running third party services (typically for testing).- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description OfficeFloorDockerUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DockerContainerInstance
ensureContainerAvailable(java.lang.String containerName, java.lang.String imageName, java.util.function.Function<com.github.dockerjava.api.DockerClient,com.github.dockerjava.api.command.CreateContainerCmd> createContainer)
Ensures the docker container is available.static DockerNetworkInstance
ensureNetworkAvailable(java.lang.String networkName)
Ensures the docker network is available.
-
-
-
Method Detail
-
ensureNetworkAvailable
public static DockerNetworkInstance ensureNetworkAvailable(java.lang.String networkName) throws java.lang.Exception
Ensures the docker network is available.- Parameters:
networkName
- Network name.- Returns:
DockerNetworkInstance
of manage docker network.- Throws:
java.lang.Exception
- If fails to ensure docker network available.
-
ensureContainerAvailable
public static DockerContainerInstance ensureContainerAvailable(java.lang.String containerName, java.lang.String imageName, java.util.function.Function<com.github.dockerjava.api.DockerClient,com.github.dockerjava.api.command.CreateContainerCmd> createContainer) throws java.lang.Exception
Ensures the docker container is available.- Parameters:
containerName
- Name of docker container.imageName
- Name of the docker image.createContainer
- Factory for theCreateContainerCmd
if container not running.- Returns:
DockerContainerInstance
to manage running docker container.- Throws:
java.lang.Exception
- If fails to ensure docker container available.
-
-