public abstract class DockerRule extends java.lang.Object implements org.junit.rules.TestRule, ContainerListener
JUnit rule starting a docker container before the test and killing it afterwards.
Uses spotify/docker-client. Adapted from https://github.com/geowarin/docker-junit-rule
| Constructor and Description |
|---|
DockerRule(DockerConfig config) |
| Modifier and Type | Method and Description |
|---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description) |
protected abstract void |
configureContainer(com.spotify.docker.client.messages.ContainerConfig.Builder builder) |
protected abstract void |
configureHost(com.spotify.docker.client.messages.HostConfig.Builder builder) |
protected Container |
createContainer() |
Container |
getContainer() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonStartedpublic DockerRule(DockerConfig config)
public final org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
apply in interface org.junit.rules.TestRuleprotected abstract void configureContainer(com.spotify.docker.client.messages.ContainerConfig.Builder builder)
protected abstract void configureHost(com.spotify.docker.client.messages.HostConfig.Builder builder)
protected Container createContainer()
public final Container getContainer()