Class MockServerRule
java.lang.Object
org.mockserver.junit.MockServerRule
com.atlassian.crowd.acceptance.utils.MockServerRule
- All Implemented Interfaces:
org.junit.rules.TestRule
public class MockServerRule
extends org.mockserver.junit.MockServerRule
Improved version of
MockServerRule
:
-
It does not find new free port if
perTestSuite
is set to true. The original implementation, even when mock server is reused, callsPortFactory.findFreePort()
in the constructor. This call is unnecessary ans slows down the test. -
Supports providing log level and defaults to
Level.WARN
. WithLevel.INFO
there were too many logged lines and builds were crashing on Bamboo.
-
Constructor Summary
ConstructorDescriptionMockServerRule
(Object target) MockServerRule
(Object target, boolean perTestSuite) MockServerRule
(Object target, boolean perTestSuite, org.slf4j.event.Level logLevel) -
Method Summary
Modifier and TypeMethodDescriptionorg.junit.runners.model.Statement
apply
(org.junit.runners.model.Statement base, org.junit.runner.Description description) Methods inherited from class org.mockserver.junit.MockServerRule
getClient, getPort, getPorts
-
Constructor Details
-
MockServerRule
-
MockServerRule
-
MockServerRule
-
-
Method Details
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description) - Specified by:
apply
in interfaceorg.junit.rules.TestRule
- Overrides:
apply
in classorg.mockserver.junit.MockServerRule
-