springtainer-mockserver
Dependency
<dependency>
<groupId>com.avides.springboot.springtainer</groupId>
<artifactId>springtainer-mockserver</artifactId>
<version>1.3.0-RC2</version>
<scope>test</scope>
</dependency>
Configuration
Properties consumed (in bootstrap-it.properties
):
embedded.container.mockserver.enabled
(default istrue
)embedded.container.mockserver.startup-timeout
(default is30
)embedded.container.mockserver.docker-image
(default isjamesdbloom/mockserver:mockserver-5.7.1
)embedded.container.mockserver.server-port
(default is1080
)
Properties provided (in application-it.properties
):
embedded.container.mockserver.host
embedded.container.mockserver.url
embedded.container.mockserver.server-port
Example for minimal configuration in application-it.properties
:
rest.any-mock-subject.url=${embedded.container.mockserver.url}
A properly configured MockServerClient is available as bean.
Logging
To reduce logging insert this into the logback-configuration:
<!-- Springtainer -->
<logger name="com.github.dockerjava.jaxrs" level="WARN" />
<logger name="com.github.dockerjava.core.command" level="WARN" />
<logger name="org.apache.http" level="WARN" />
Labels
The container exports multiple labels to analyze running springtainers:
SPRINGTAINER_SERVICE=mockserver
SPRINGTAINER_IMAGE=${embedded.container.mockserver.docker-image}
SPRINGTAINER_STARTED=$currentTimestamp