public class PactRunner<I extends Interaction>
JUnit Runner runs pacts against provider To set up name of tested provider use Provider annotation To point on pact's source use PactBroker, PactFolder or PactSource annotations
To point provider for testing use combination of Target interface and TestTarget annotation
There is out-of-the-box implementation of Target:
class HttpTarget that will play interaction from pacts as http request and check http responses
Runner supports:
org.junit.BeforeClass, org.junit.AfterClass and org.junit.ClassRule annotations, that will be run once - before/after whole contract test suite
org.junit.Before, org.junit.After and org.junit.Rule annotations, that will be run before/after each test of interaction WARNING: please note, that only org.junit.rules.TestRule is possible to use with this runner, i.e. org.junit.rules.MethodRule IS NOT supported
class HttpTarget,
State,
State@NotNull public static java.lang.String WARNING_ON_IGNORED_IOERROR
public static au.com.dius.pact.provider.junit.PactRunner.Companion Companion
public PactRunner(@NotNull
java.lang.Class<?> clazz)
JUnit Runner runs pacts against provider To set up name of tested provider use Provider annotation To point on pact's source use PactBroker, PactFolder or PactSource annotations
To point provider for testing use combination of Target interface and TestTarget annotation
There is out-of-the-box implementation of Target:
class HttpTarget that will play interaction from pacts as http request and check http responses
Runner supports:
org.junit.BeforeClass, org.junit.AfterClass and org.junit.ClassRule annotations, that will be run once - before/after whole contract test suite
org.junit.Before, org.junit.After and org.junit.Rule annotations, that will be run before/after each test of interaction WARNING: please note, that only org.junit.rules.TestRule is possible to use with this runner, i.e. org.junit.rules.MethodRule IS NOT supported
class HttpTarget,
State,
Stateprotected void setupInteractionRunners(@NotNull
org.junit.runners.model.TestClass testClass,
@NotNull
java.util.List<? extends au.com.dius.pact.core.model.Pact<I>> pacts,
@NotNull
au.com.dius.pact.provider.junitsupport.loader.PactLoader pactLoader)
@NotNull protected InteractionRunner<I> newInteractionRunner(@NotNull org.junit.runners.model.TestClass testClass, @NotNull au.com.dius.pact.core.model.Pact<I> pact, @NotNull au.com.dius.pact.core.model.PactSource pactSource)
@NotNull
protected java.util.List<au.com.dius.pact.core.model.Pact> filterPacts(@NotNull
java.util.List<? extends au.com.dius.pact.core.model.Pact<I>> pacts)
@NotNull protected java.util.List<au.com.dius.pact.provider.junit.InteractionRunner> getChildren()
@NotNull
protected org.junit.runner.Description describeChild(@NotNull
InteractionRunner<I> child)
protected void runChild(@NotNull
InteractionRunner<I> interaction,
@NotNull
org.junit.runner.notification.RunNotifier notifier)
@NotNull
protected au.com.dius.pact.provider.junitsupport.loader.PactLoader getPactSource(@NotNull
org.junit.runners.model.TestClass clazz,
@Nullable
au.com.dius.pact.provider.junitsupport.Consumer consumerInfo)