public class PactRunner
extends org.junit.runners.ParentRunner<au.com.dius.pact.provider.junit.InteractionRunner>
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:
HttpTarget that will play interaction from pacts as http request and check http responses
Runner supports:
- BeforeClass, AfterClass and ClassRule annotations,
that will be run once - before/after whole contract test suite
- Before, After and Rule annotations,
that will be run before/after each test of interaction
WARNING: please note, that only TestRule is possible to use with this runner,
i.e. MethodRule IS NOT supported
- State - before each interaction that require state change,
all methods annotated by State with appropriate state listed will be invoked
| Constructor and Description |
|---|
PactRunner(java.lang.Class<?> clazz) |
| Modifier and Type | Method and Description |
|---|---|
protected org.junit.runner.Description |
describeChild(au.com.dius.pact.provider.junit.InteractionRunner child) |
protected java.util.List<au.com.dius.pact.provider.junit.InteractionRunner> |
getChildren() |
protected PactLoader |
getPactSource(org.junit.runners.model.TestClass clazz) |
protected void |
runChild(au.com.dius.pact.provider.junit.InteractionRunner interaction,
org.junit.runner.notification.RunNotifier notifier) |
childrenInvoker, classBlock, classRules, collectInitializationErrors, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, isIgnored, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClassespublic PactRunner(java.lang.Class<?> clazz)
throws org.junit.runners.model.InitializationError
org.junit.runners.model.InitializationErrorprotected java.util.List<au.com.dius.pact.provider.junit.InteractionRunner> getChildren()
getChildren in class org.junit.runners.ParentRunner<au.com.dius.pact.provider.junit.InteractionRunner>protected org.junit.runner.Description describeChild(au.com.dius.pact.provider.junit.InteractionRunner child)
describeChild in class org.junit.runners.ParentRunner<au.com.dius.pact.provider.junit.InteractionRunner>protected void runChild(au.com.dius.pact.provider.junit.InteractionRunner interaction,
org.junit.runner.notification.RunNotifier notifier)
runChild in class org.junit.runners.ParentRunner<au.com.dius.pact.provider.junit.InteractionRunner>protected PactLoader getPactSource(org.junit.runners.model.TestClass clazz) throws org.junit.runners.model.InitializationError
org.junit.runners.model.InitializationError