Annotation Interface VersionedPactUrl


@Retention(RUNTIME) @Target(TYPE) @Inherited public @interface VersionedPactUrl
Used to point Pact runner to a versioned source of pacts for contract tests.

Use ${any.variable} in the url and specify any.variable as a system property.

For example, when you annotate a provider test class with:

@VersionedPactUrl(urls = {"http://artifactory:8081/artifactory/consumercontracts/foo-bar/${foo.version}/foo-bar-${foo.version}.json"})
And pass a system property foo.version to the JVM, for example -Dfoo.version=123

Then the pact tests will fetch the following contract:

http://artifactory:8081/artifactory/consumercontracts/foo-bar/123/foo-bar-123.json
See Also:
  • pact loader
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Authentication to use, if needed.
  • Element Details

    • urls

      String[] urls
      Returns:
      a list of urls to pact files
    • auth

      Authentication to use, if needed. For basic auth, set the username and password. For bearer tokens, use the token attribute.
      Default:
      @au.com.dius.pact.provider.junitsupport.loader.Authentication