Package 

Class PactRunner

  • All Implemented Interfaces:
    org.junit.runner.Describable , org.junit.runner.manipulation.Filterable , org.junit.runner.manipulation.Orderable , org.junit.runner.manipulation.Sortable

    
    public class PactRunner
    extends ParentRunner<InteractionRunner>
                        

    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: 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.MethodRuleIS NOT supported

    • State - before each interaction that require state change, all methods annotated by State with appropriate state listed will be invoked

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class PactRunner.Companion
    • Constructor Summary

      Constructors 
      Constructor Description
      PactRunner(Class<?> clazz)
    • Method Summary

      Modifier and Type Method Description
      • Methods inherited from class au.com.dius.pact.provider.junit.PactRunner

        childrenInvoker, classBlock, classRules, collectInitializationErrors, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, isIgnored, order, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses, withInterruptIsolation
      • Methods inherited from class org.junit.runners.ParentRunner

        testCount
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PactRunner

        PactRunner(Class<?> clazz)