Class DockerContainerHolder<T extends org.jenkinsci.test.acceptance.docker.DockerContainer>
java.lang.Object
org.jenkinsci.test.acceptance.docker.DockerContainerHolder<T>
- All Implemented Interfaces:
jakarta.inject.Provider<T>,Closeable,AutoCloseable,AutoCleaned
- Direct Known Subclasses:
MailhogProvider
@TestScope
public class DockerContainerHolder<T extends org.jenkinsci.test.acceptance.docker.DockerContainer>
extends Object
implements jakarta.inject.Provider<T>, AutoCleaned
Inject this object to automate the cleanup of a running container at the end of the test case.
- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()TestCleanerwill call this at the end of the test automaticallyget()Lazily starts a container and returns the instance.org.jenkinsci.test.acceptance.docker.DockerImage.Starter<T>starter()Provides a starter directly, so you can customize it a bit before callingDockerImage.Starter.start().
-
Constructor Details
-
DockerContainerHolder
public DockerContainerHolder()
-
-
Method Details
-
get
Lazily starts a container and returns the instance.- Specified by:
getin interfacejakarta.inject.Provider<T extends org.jenkinsci.test.acceptance.docker.DockerContainer>
-
starter
public org.jenkinsci.test.acceptance.docker.DockerImage.Starter<T> starter() throws IOException, InterruptedExceptionProvides a starter directly, so you can customize it a bit before callingDockerImage.Starter.start().- Throws:
IOExceptionInterruptedException
-
close
TestCleanerwill call this at the end of the test automatically- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-