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, calls PortFactory.findFreePort() in the constructor. This call is unnecessary ans slows down the test.
  • Supports providing log level and defaults to Level.WARN. With Level.INFO there were too many logged lines and builds were crashing on Bamboo.
  • Constructor Details

    • MockServerRule

      public MockServerRule(Object target)
    • MockServerRule

      public MockServerRule(Object target, boolean perTestSuite)
    • MockServerRule

      public MockServerRule(Object target, boolean perTestSuite, org.slf4j.event.Level logLevel)
  • 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 interface org.junit.rules.TestRule
      Overrides:
      apply in class org.mockserver.junit.MockServerRule