Class WireMockMultiServerRule

  • All Implemented Interfaces:
    org.junit.rules.MethodRule, org.junit.rules.TestRule
    Direct Known Subclasses:
    GitHubWireMockRule

    public class WireMockMultiServerRule
    extends Object
    implements org.junit.rules.MethodRule, org.junit.rules.TestRule
    The standard WireMockRule eagerly initializes a WireMockServer. This version supports multiple servers in one rule and takes a lazy approach to intitialization allowing us to isolate files snapshots for each method.
    Author:
    Liam Newman
    • Field Detail

      • servers

        protected final Map<String,​com.github.tomakehurst.wiremock.WireMockServer> servers
    • Constructor Detail

      • WireMockMultiServerRule

        public WireMockMultiServerRule​(com.github.tomakehurst.wiremock.core.Options options)
      • WireMockMultiServerRule

        public WireMockMultiServerRule​(com.github.tomakehurst.wiremock.core.Options options,
                                       boolean failOnUnmatchedRequests)
      • WireMockMultiServerRule

        public WireMockMultiServerRule()
    • Method Detail

      • getMethodName

        public String getMethodName()
      • 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
      • apply

        public org.junit.runners.model.Statement apply​(org.junit.runners.model.Statement base,
                                                       org.junit.runners.model.FrameworkMethod method,
                                                       Object target)
        Specified by:
        apply in interface org.junit.rules.MethodRule
      • initializeServers

        protected void initializeServers()
      • initializeServer

        protected final void initializeServer​(String serverId,
                                              com.github.tomakehurst.wiremock.extension.Extension... extensions)
      • before

        protected void before()
      • after

        protected void after()