JVM version of Pact Enables consumer driven contract testing

Overview

Pact-JVM

Pact-JVM Build Maven Central

JVM implementation of the consumer driven contract library pact.

From the Ruby Pact website:

Define a pact between service consumers and providers, enabling "consumer driven contract" testing.

Pact provides an RSpec DSL for service consumers to define the HTTP requests they will make to a service provider and the HTTP responses they expect back. These expectations are used in the consumers specs to provide a mock service provider. The interactions are recorded, and played back in the service provider specs to ensure the service provider actually does provide the response the consumer expects.

This allows testing of both sides of an integration point using fast unit tests.

This gem is inspired by the concept of "Consumer driven contracts". See https://martinfowler.com/articles/consumerDrivenContracts.html for more information.

Read Getting started with Pact for more information on how to get going.

Contact

Links

Tutorial (60 minutes)

Learn everything in Pact in 60 minutes: https://github.com/pact-foundation/pact-workshop-jvm-spring.

The workshop takes you through all of the key concepts of consumer and provider testing using a Spring boot application.

Documentation

Additional documentation can be found at docs.pact.io, in the Pact Wiki, and in the Pact-JVM wiki. Stack Overflow is also a good source of help, as is the Slack workspace.

Supported JDK and specification versions:

Branch Specification JDK Kotlin Version Latest Version Notes
4.3.x master V4 11+ 1.5.21 4.3.4 Upgrade notes
4.2.x V4 (1) 11-15 (2) 1.4.32 4.2.19
4.1.x V3 8-12 1.3.72 4.1.33

Notes:

  • 1: V4 specification support is only partially implemented with 4.2.x
  • 2: v4.2.x may run on JDK 16, but the build for it does not.

Previous versions (not actively supported)

Branch Specification JDK Kotlin Version Scala Versions Latest Version
4.0.x V3 8-12 1.3.71 N/A 4.0.10
3.6.x V3 8 1.3.71 2.12 3.6.15
3.5.x V3 8 1.1.4-2 2.12, 2.11 3.5.25
3.5.x-jre7 V3 7 1.1.4-2 2.11 3.5.7-jre7.0
2.4.x V2 6 N/A 2.10, 2.11 2.4.20

NOTE: The JARs produced by this project have changed with 4.1.x to better align with Java 9 JPMS. The artefacts are now:

au.com.dius.pact:consumer
au.com.dius.pact.consumer:groovy
au.com.dius.pact.consumer:junit
au.com.dius.pact.consumer:junit5
au.com.dius.pact.consumer:java8
au.com.dius.pact.consumer:specs2_2.13
au.com.dius.pact:pact-jvm-server
au.com.dius.pact:provider
au.com.dius.pact.provider:scalatest_2.13
au.com.dius.pact.provider:spring
au.com.dius.pact.provider:maven
au.com.dius.pact:provider
au.com.dius.pact.provider:junit
au.com.dius.pact.provider:junit5
au.com.dius.pact.provider:scalasupport_2.13
au.com.dius.pact.provider:lein
au.com.dius.pact.provider:gradle
au.com.dius.pact.provider:specs2_2.13
au.com.dius.pact.provider:junit5spring
au.com.dius.pact.core:support
au.com.dius.pact.core:model
au.com.dius.pact.core:matchers
au.com.dius.pact.core:pactbroker

Service Consumers

Pact-JVM has a number of ways you can write your service consumer tests.

I Use Scala

You want to look at: pact4s or scala-pact

I Use Java

You want to look at: junit for JUnit 4 tests and junit5 for JUnit 5 tests. Also, if you are using Java 8 or above, there is an updated DSL for consumer tests.

I Use Groovy or Grails

You want to look at: groovy or junit

(Use Clojure I)

Clojure can call out to Java, so have a look at junit. For an example look at example_clojure_consumer_pact_test.clj.

I Use some other jvm language or test framework

You want to look at: Consumer

My Consumer interacts with a Message Queue

As part of the V3 pact specification, we have defined a new pact file for interactions with message queues. For an implementation of a Groovy consumer test with a message pact, have a look at PactMessageBuilderSpec.groovy.

Service Providers

Once you have run your consumer tests, you will have generated some Pact files. You can then verify your service providers with these files.

I am writing a provider and want to ...

verify pacts with SBT

You want to look at: pact4s or scala-pact

verify pacts with Gradle

You want to look at: pact gradle plugin

verify pacts with Maven

You want to look at: pact maven plugin

verify pacts with JUnit tests

You want to look at: junit provider support for JUnit 4 tests and junit5 for JUnit 5 tests

verify pacts with Leiningen

You want to look at: pact leiningen plugin

verify pacts with a Spring MVC project

Have a look at spring or Spring MVC Pact Test Runner (Not maintained).

I want to verify pacts but don't want to use sbt or gradle or leiningen

You want to look at: provider

verify interactions with a message queue

As part of the V3 pact specification, we have defined a new pact file for interactions with message queues. The Gradle pact plugin supports a mechanism where you can verify V3 message pacts, have a look at pact gradle plugin. The JUnit pact library also supports verification of V3 message pacts, have a look at junit.

I Use Ruby or Go or something else

The pact-jvm libraries are pure jvm technologies and do not have any native dependencies.

However, if you have a ruby provider, the json produced by this library is compatible with the ruby pact library. You'll want to look at: Ruby Pact.

For .Net, there is Pact-net.

For JS, there is Pact-JS.

For Go, there is Pact-go.

For Rust, there is Pact-Rust.

Have a look at implementations in other languages.

I Use something completely different

There's a limit to how much we can help, however check out pact-jvm-server

How do I transport my pacts from consumers to providers?

You want to look at: Pact Broker

Which is a project that aims at providing tooling to coordinate pact generation and delivery between projects.

I want to contribute

Documentation for contributors is here.

Test Analytics

We are tracking anonymous analytics to gather important usage statistics like JVM version and operating system. To disable tracking, set the 'pact_do_not_track' system property or environment variable to 'true'.

Comments
  • Maven Pact-Verification

    Maven Pact-Verification

    I am new to using pact-jvm, and I think I have completed my consumer tests, and I'm wondering how to produce my pact file, and how to test it against my provider. I'm looking at the example in the ReadMe, but I feel I may be misunderstanding it. Can anyone give any insight or examples? I'm using maven.

    opened by mcgriffa 24
  • [pact-jvm-provider-gradle] Paths containing url encoded text cannot be verified

    [pact-jvm-provider-gradle] Paths containing url encoded text cannot be verified

    When a path in the generated json pact file contains some already url encoded text (e.g. xx%20xx -> xx%2520xx), it is url encoded again after it is read in for use by gradle pactVerify which results in the verification failing.

    This does not occur when the same generated json file is run using pact-provider-proxy.

    bug 
    opened by chrisholmes 23
  • When publishing verification results, only the errors are sent

    When publishing verification results, only the errors are sent

    When publishing verification results, only the errors are being sent. This causes the Pact broker to see the passing interactions as un-verified.

    For a test with 3 interactions, if two pass and one fails, the following entries are logged:

    Received test result 'au.com.dius.pact.core.pactbroker.TestResult$Ok@3f693160' for Pact pactflow-example-provider-springboot-pactflow-example-consumer and a request to get a product (Pact Broker https://testdemo.pactflow.io/pacts/provider/pactflow-example-provider-springboot/consumer/pactflow-example-consumer/pact-version/4a6c2017e4f913c5b18ee0b526eae842567bf489)
    2020-12-08 12:27:12.818 DEBUG 33876 --- [    Test worker] a.c.d.p.p.DefaultTestResultAccumulator   : Number of interactions #3 and results: [au.com.dius.pact.core.pactbroker.TestResult$Ok@3f693160]
    2020-12-08 12:27:12.818  WARN 33876 --- [    Test worker] a.c.d.p.p.DefaultTestResultAccumulator   : Not all of the 3 were verified. The following were missing:
    2020-12-08 12:27:12.818  WARN 33876 --- [    Test worker] a.c.d.p.p.DefaultTestResultAccumulator   :     a request to get a product
    2020-12-08 12:27:12.818  WARN 33876 --- [    Test worker] a.c.d.p.p.DefaultTestResultAccumulator   :     a request to get all products
    
    2020-12-08 12:27:13.029 DEBUG 33876 --- [    Test worker] a.c.d.p.p.DefaultTestResultAccumulator   : Received test result 'au.com.dius.pact.core.pactbroker.TestResult$Ok@3f693160' for Pact pactflow-example-provider-springboot-pactflow-example-consumer and a request to get all products (Pact Broker https://testdemo.pactflow.io/pacts/provider/pactflow-example-provider-springboot/consumer/pactflow-example-consumer/pact-version/4a6c2017e4f913c5b18ee0b526eae842567bf489)
    2020-12-08 12:27:13.030 DEBUG 33876 --- [    Test worker] a.c.d.p.p.DefaultTestResultAccumulator   : Number of interactions #3 and results: [au.com.dius.pact.core.pactbroker.TestResult$Ok@3f693160, Failed(results=[{interactionId=ba08b56e3fecb8a49c7f7a2d509d9fe3183a44cf, attribute=status, description=expected status of 404 but was 200}], description=Response status did not match), au.com.dius.pact.core.pactbroker.TestResult$Ok@3f693160]
    2020-12-08 12:27:13.030 DEBUG 33876 --- [    Test worker] a.c.d.p.p.DefaultTestResultAccumulator   : All interactions for Pact pactflow-example-provider-springboot-pactflow-example-consumer have a verification result
    

    Then when the results are published:

    2020-12-08 12:27:13.447 DEBUG 33876 --- [    Test worker] a.c.d.p.c.pactbroker.PactBrokerClient    : Test result = Failed(results=[{interactionId=ba08b56e3fecb8a49c7f7a2d509d9fe3183a44cf, attribute=status, description=expected status of 404 but was 200}], description=Response status did not match)
    2020-12-08 12:27:13.448 DEBUG 33876 --- [    Test worker] a.c.dius.pact.core.pactbroker.HalClient  : Posting JSON to https://testdemo.pactflow.io/pacts/provider/pactflow-example-provider-springboot/consumer/pactflow-example-consumer/pact-version/4a6c2017e4f913c5b18ee0b526eae842567bf489/verification-results
    {"providerApplicationVersion":"cdbbf3f+1607390821","success":false,"testResults":[{"interactionId":"ba08b56e3fecb8a49c7f7a2d509d9fe3183a44cf","mismatches":[{"attribute":"status","description":"expected status of 404 but was 200"}],"success":false}]}
    

    Only the error is sent.

    bug 
    opened by uglyog 22
  • allow dynamic content matching in response body

    allow dynamic content matching in response body

    We are trying to create a pact with an endpoint response that contains a dynamic timestamp, is there a way I can generate the json file with a regex pattern?

    opened by cymeng 22
  • Following Pack-JVM-Example, the packVerify called from gradlew never updated the

    Following Pack-JVM-Example, the packVerify called from gradlew never updated the "Last Verified" field on ariman.pact.dius.com.au

    Dear

    I'm new with PACT and eager to setup a demo following the Pack-JVM-Example. Everything worked well following the instructions, but...the .\gradlew :example-provider:pactVerify never updated the "Last Verified" field of the public shared pack broker.

    May I know if I missed anything here?

    Thanks

    opened by aricalee 21
  • AmqpTarget doesn't find @PactVerifyProvider annotation

    AmqpTarget doesn't find @PactVerifyProvider annotation

    I'm running a simple message provider test:

    @RunWith(PactRunner.class)
    @Provider("userservice")
    @PactFolder("../pact-message-consumer/target/pacts")
    @SpringBootTest
    public class MessageProviderTest {
    
    	@TestTarget
    	public final Target target = new AmqpTarget(Collections.singletonList("io.reflectoring"));
    
    	@PactVerifyProvider("a user created message")
    	public String verifyUserCreatedMessage() {
    		return "{\"testParam1\": \"value1\",\"testParam2\": \"value2\"}";
    	}
    }
    

    Executing this test results in

    Failures:
    
    0) a user created message
          No annotated methods were found for interaction 'a user created message'. You need to provide a method annotated with @PactVerifyProvider("a user created message") that returns the message contents.
    

    The cause for this is that the Reflections call in ProviderVerifier#verifyResponseByInvokingProviderMethods doesn't find the @PactVerifyProvider annotation on my test method. There must be something wrong with the setup of the Reflections instance (class loader?).

    When I'm using the following code snippet from a test, the annotation is found:

    Reflections r = new Reflections(ClasspathHelper.forPackage("io.reflectoring"), new MethodAnnotationsScanner());
    Set<Method> methods = r.getMethodsAnnotatedWith(PactVerifyProvider.class);
    
    opened by thombergs 20
  • @PactBroker not reading Spring properties with JUnit 5

    @PactBroker not reading Spring properties with JUnit 5

    If you provide system properties in Spring application.yml these won't be read by the @PactBroker annotation when running with JUnit 5. This works fine if you provide them as normal system properties.

    This issue seems to have been fixed for the JUnit 4 runners in here: https://github.com/DiUS/pact-jvm/issues/632

    I can see that the problem has been fixed by adding a property resolver, and that it is also possible to pass a valueResolver attribute for the @PactBroker annotation. However, since you need a Spring context to be able to create such a resolver for Spring, it cannot be done with the annotation.

    I also tried to add a resolver into PactVerificationContext in @BeforeEach but that didn't seem to do the trick.

    enhancement 
    opened by arhohuttunen 19
  • Requiring the exact body for an expectation is not scalable

    Requiring the exact body for an expectation is not scalable

    Having to provide the exact body for a request is not scalable. Have a look at the resulting ruby pact issue #1

    My current project has json bodies that include UUIDs and timestamps, which will never be known beforehand.

    By adding a path to a matcher, it would mean I could only match on the things that are important in the body.

    enhancement 
    opened by uglyog 18
  • Json parsing error thrown while running the service consumer test

    Json parsing error thrown while running the service consumer test

    Hey guys,

    We have a pact-jvm(pact-jvm-consumer-junit_2.11:3.4.1) setup running the junit tests to generate the pact file.Recently we have started getting this error while running the tests. Stacktrace doesnt give a lot of info but looks like some discrepancy in reading the Pact file. Not sure if its how I am generating the response causing the issue.

    groovy.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object
    
    The current character read is '?' with an int value of 0
    Unable to determine the current character, it is not a string, number, array, or object
    line number 1
    index number 255
    ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
    ...............................................................................................................................................................................................................................................................^
    	at groovy.json.internal.JsonParserCharArray.decodeValueInternal(JsonParserCharArray.java:206)
    	at groovy.json.internal.JsonParserCharArray.decodeValue(JsonParserCharArray.java:157)
    	at groovy.json.internal.JsonParserCharArray.decodeFromChars(JsonParserCharArray.java:46)
    	at groovy.json.internal.JsonParserCharArray.parse(JsonParserCharArray.java:384)
    	at groovy.json.internal.BaseJsonParser.parse(BaseJsonParser.java:128)
    	at groovy.json.internal.BaseJsonParser.parse(BaseJsonParser.java:151)
    	at groovy.json.JsonSlurper.parseFile(JsonSlurper.java:365)
    	at groovy.json.JsonSlurper.parse(JsonSlurper.java:348)
    	at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
    	at au.com.dius.pact.model.PactReader.loadFile(PactReader.groovy:159)
    	at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
    	at au.com.dius.pact.model.PactReader.loadPact(PactReader.groovy:26)
    	at au.com.dius.pact.model.PactReader.loadPact(PactReader.groovy)
    	at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
    	at au.com.dius.pact.model.BasePact.write(BasePact.groovy:109)
    	at au.com.dius.pact.consumer.BaseMockServer.runAndWritePact(MockHttpServer.kt:147)
    	at au.com.dius.pact.consumer.ConsumerPactRunnerKt.runConsumerTest(ConsumerPactRunner.kt:13)
    	at au.com.dius.pact.consumer.BaseProviderRule.runPactTest(BaseProviderRule.java:148)
    	at au.com.dius.pact.consumer.BaseProviderRule.access$100(BaseProviderRule.java:21)
    	at au.com.dius.pact.consumer.BaseProviderRule$1.evaluate(BaseProviderRule.java:76)
    	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:114)
    	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:57)
    	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:66)
    	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:497)
    	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
    	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
    	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
    	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:497)
    	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:377)
    	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    	at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	at java.lang.Thread.run(Thread.java:745)
    

    This is one of the interaction setup where we are getting this error,

        @Pact(consumer = CONSUMER_ID)
        public RequestResponsePact getBoardsForMobile(PactDslWithProvider builder) {
            return builder
                    .given("Project with boards")
                    .uponReceiving("GET all boards")
                    .matchPath(BOARDS_API_PATTERN, BOARDS_API_EXAMPLE)
                    .method("GET")
                    .query("maxResults=10")
                    .willRespondWith()
                    .status(HttpStatus.SC_OK)
                    .headers(ImmutableMap.of("Content-Type", "application/json"))
                    .body(new PactDslJsonBody()
                            .minArrayLike("values", 1)
                            .id()
                            .stringMatcher("type", "CORE")
                            .stringMatcher("name", "Business")
                            .stringMatcher("moduleKey", CORE_MODULE_EXAMPLE)
                            .closeObject()
                            .object()
                            .id()
                            .stringMatcher("type", "SCRUM")
                            .stringMatcher("name", "DEMO board")
                            .stringMatcher("moduleKey", AGILE_MODULE_EXAMPLE)
                            .closeObject()
                            .closeArray()
                            .asBody())
                    .toPact();
        }
    

    And this is how the json from pact file looks like,

    mobile-rest-plugin will respond with:
    
    {
      "status": 200,
      "headers": {
        "Content-Type": "application/json"
      },
      "body": {
        "values": [
          {
            "name": "Business",
            "id": 8124081232,
            "type": "CORE",
            "moduleKey": "core-mobile-board-service"
          },
          {
            "name": "DEMO board",
            "id": 4597649782,
            "type": "SCRUM",
            "moduleKey": "agile-mobile-board-service"
          }
        ]
      }
    }
    
    bug 
    opened by sushantchoudhary 17
  • Pact consumer - when running a JUnit 4 spec with multiple tests every second pact test fails

    Pact consumer - when running a JUnit 4 spec with multiple tests every second pact test fails

    We are using pact-jvm-provider-gradle_2.11::3.2.1 to test the downstream dependency in a springboot app. We have found that in one of our specs that has multiple pact tests every second test fails saying that the expected requests were not received. If we run them individually each test works fine, and also when we put a 4 second delay into a @Before, then they all pass. We have also tried running them in a different order and it is always every second test that fails, regardless.

    We have tried using versions 3.3.2, 3.3.1, 3.2.13 and 3.1.3 and all have the same problem.

    bug 
    opened by andrewspinks 17
  • Only one `@Pact` clause can be used

    Only one `@Pact` clause can be used

    With the new 3.0 release, only the last method defining a pact using the @Pact annotation (for the same producer/consumer pair) is regarded. Swapping the order of the two methods in the file, not changing anything else, causes the other definition to be available, while the definition that worked before now is ignored.

    bug 
    opened by C-Otto 17
  • feat: Auto DSL based on Kotlin object validating type of the item in the List

    feat: Auto DSL based on Kotlin object validating type of the item in the List

    When generating a DSL based on a Kotlin object, the item type of the list should be validated.

    Before this change, the code was creating one DSL only to check if the array exists in the parent object, without validating if the object type in the list is correct.

    So now, once the data contains a List<Type> in the constructor as a mandatory field, that has been used to create a type validation for that assuring the correct Type in the list is present.

    That said, if we have this object below:

    data class ListObjectRequiredProperty(val properties: List<String>)
    

    The DSL generated will be equivalent to:

                LambdaDsl.newJsonBody { it.array("properties") { arr ->
                    arr.stringType("String")
                } }
    
    opened by samukce 0
  • chore(deps): bump actions/github-script from 5 to 6

    chore(deps): bump actions/github-script from 5 to 6

    Bumps actions/github-script from 5 to 6.

    Release notes

    Sourced from actions/github-script's releases.

    v6.0.0

    What's Changed

    Breaking Changes

    With the update to Node 16 in #235, all scripts will now be run with Node 16 rather than Node 12.

    New Contributors

    Full Changelog: https://github.com/actions/github-script/compare/v5...v6.0.0

    v5.1.1

    What's Changed

    Full Changelog: https://github.com/actions/github-script/compare/v5.1.0...v5.1.1

    v5.1.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/github-script/compare/v5.0.0...v5.1.0

    Commits
    • d556fea Merge pull request #300 from actions/joshmgross/v6.3.3
    • 01fde8b Update version to 6.3.3
    • 633e9fd Merge pull request #279 from nineinchnick/update-glob
    • ee124b1 Update dist
    • ca24d5f Update @actions/glob license version
    • c09747e Merge branch 'main' into update-glob
    • 1005277 Merge pull request #299 from actions/joshmgross/v6.3.2
    • 085a775 Bump version to 6.3.2
    • 6871f0f Merge pull request #295 from rentziass/rentziass/update-actions-core
    • 7ed7182 Update @​actions/core to 1.10.0
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • java.lang.NoSuchMethodError: org.fusesource.jansi.AnsiConsole.out()Ljava/io/PrintStream

    java.lang.NoSuchMethodError: org.fusesource.jansi.AnsiConsole.out()Ljava/io/PrintStream

    I am using pact-jvm-provider-maven 4.0.10 and running into this incompatibility issue. The stack trace is

    Caused by: java.lang.NoSuchMethodError: org.fusesource.jansi.AnsiConsole.out()Ljava/io/PrintStream;
        at au.com.dius.pact.provider.ProviderUtils.loadPactFiles (ProviderUtils.kt:39)
        at au.com.dius.pact.provider.ProviderUtils.loadPactFiles$default (ProviderUtils.kt:25)
        at au.com.dius.pact.provider.maven.PactProviderMojo.loadPactFiles (PactProviderMojo.kt:164)
        at au.com.dius.pact.provider.maven.PactProviderMojo.execute (PactProviderMojo.kt:92)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
        at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
        at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
        at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    
    opened by LinghaoYu 1
  • Add support for setting provider states on `consumer.dsl.PactBuilder`

    Add support for setting provider states on `consumer.dsl.PactBuilder`

    When using the plugins framework, it would be useful to be able to add provider states to a pact, so that the provider can correctly set up their tests. (.given() in the consumer legacy DSL as documented here, and @State on the provider side as documented here.)

    The PactBuilder class (example usage here) currently does not implement .given(), or an equivalent.

    opened by rmartine-ias 0
  • PactConsumerTestExt failure with JUnit Jupiter Parameter Resolving in @BeforeAll

    PactConsumerTestExt failure with JUnit Jupiter Parameter Resolving in @BeforeAll

    Hey 👋🏻,

    We're doing some setup work in our @BeforeAll method and inject various parameters to the lifecycle method that get resolved by other JUnit Jupiter extensions. However, our test fail because when it's the turn of the PactConsumerTestExt to determine if this extension is responsible for resolving the parameter, it expects a test method to be present in the context. That's not the case as no method has been selected yet as we're in the @BeforeAll lifecylce.

    I tested it with JUnit 5.9.0 and au.com.dius.pact.consumer 4.4.2 and get the following exception:

    org.junit.jupiter.api.extension.ParameterResolutionException: Failed to resolve parameter [java.lang.String arg0] in method [static void de.rieckpil.blog.SamplePactTest.setup(java.lang.String)]: Illegal state: required test method is not present in the current ExtensionContext
            at org.junit.jupiter.engine.execution.ParameterResolutionUtils.resolveParameter(ParameterResolutionUtils.java:159)
            at org.junit.jupiter.engine.execution.ParameterResolutionUtils.resolveParameters(ParameterResolutionUtils.java:103)
            // ...
    Caused by: org.junit.platform.commons.PreconditionViolationException: Illegal state: required test method is not present in the current ExtensionContext
            at org.junit.platform.commons.util.Preconditions.condition(Preconditions.java:299)
            at org.junit.platform.commons.util.Preconditions.notNull(Preconditions.java:55)
            at org.junit.jupiter.api.extension.ExtensionContext.getRequiredTestMethod(ExtensionContext.java:241)
            at au.com.dius.pact.consumer.junit5.PactConsumerTestExt.lookupProviderInfo(PactConsumerTestExt.kt:271)
            at au.com.dius.pact.consumer.junit5.PactConsumerTestExt.supportsParameter(PactConsumerTestExt.kt:57)
            at org.junit.jupiter.engine.execution.ParameterResolutionUtils.lambda$resolveParameter$0(ParameterResolutionUtils.java:114)
           // ...
            at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
            at org.junit.jupiter.engine.execution.ParameterResolutionUtils.resolveParameter(ParameterResolutionUtils.java:115)
    

    A minimal test example looks like the following:

    @ExtendWith({PactConsumerTestExt.class, MyStringResolverExtension.class})
    @PactTestFor(providerName = "some-provider", providerType = ProviderType.ASYNCH)
    class SamplePactTest {
    
      @BeforeAll
      // when evaluating whether or not the PactConsumerTestExt is responsible for this parameter, the extension fails
      static void setup(String injectedString) {
        System.out.println(injectedString);
      }
    
      @Pact(consumer = "some-consumer")
      public MessagePact someMessage(MessagePactBuilder builder) {
        return builder.withContent(LambdaDsl.newJsonBody(object -> object.stringType("test", "Test")).build()).toPact();
      }
    
      @Test
      @PactTestFor(pactMethod = "someMessage")
      void consume(List<Message> messages) {
        System.out.println(messages);
      }
    }
    

    I assume that there's no context.requiredTestMethod present at this time of the lifecycle as the JUnit Jupiter lifecycle method is called before any test method.

      fun lookupProviderInfo(context: ExtensionContext): List<Pair<ProviderInfo, String>> {
        logger.trace { "lookupProviderInfo($context)" }
        val store = context.getStore(NAMESPACE)
        val providerInfo = when {
          store["providers"] != null -> store["providers"] as List<Pair<ProviderInfo, String>>
          else -> {
            val methodAnnotation = if (AnnotationSupport.isAnnotated(context.requiredTestMethod, PactTestFor::class.java)) {
    

    I created a minimal reproducible example here.

    We tried to explicitly order the extension but even though an extension reports it's responsible for resolving a parameter, still all other extensions in the chain are asked if they support the parameter.

    A current workaround is to use @BeforeEach where it works as there's already a selected test method. However, that's not suitable as we want our test setup work to be done only once for a test.

    opened by rieckpil 0
  • To test Multipart service using pact

    To test Multipart service using pact

    Hi Team,

    We need to write contract testing for a service which accepts requests in MultiParts. 1.Part is of File Upload(which is of Multipart/formdata content type) 2.Part is of JSON Data (which is of application/json content type).

    How can I write the pact for this.Please suggest. Used withFileUpload ->it is considering only the file upload part. How can I include the JSON request as well.

    opened by Dedeepya-Kolli 0
Releases(4_4_3)
  • 4_4_3(Dec 23, 2022)

    Bugfixes + write date/time matchers in the correct format as per the spec

    • b1d6c01c0 - fix: write date/time matchers in the correct format as per the spec #1617
    • aa117914c - fix: Update matching rule loading code to support correct + incorrect formatted date/time matchers #1617
    • 1488826aa - chore: Upgrade Gradle to 7.5.1
    • c9a62cc8d - refactor: performance improvements in core/matchers module (Matchers, Matching, CollectionUtils) (Tomasz Linkowski)
    • 21af9f54b - refactor: add missing test case for #1347 (Tomasz Linkowski)
    • 102e67362 - bugfix: fix custom header propagation in list case (Artem Ptushkin)
    Source code(tar.gz)
    Source code(zip)
  • 4_3_18(Dec 23, 2022)

    fix: write date/time matchers in the correct format as per the spec

    • b1d6c01c0 - fix: write date/time matchers in the correct format as per the spec #1617
    • aa117914c - fix: Update matching rule loading code to support correct + incorrect formatted date/time matchers #1617
    • d079d452a - chore: correct build on JDK 16+
    • 1488826aa - chore: Upgrade Gradle to 7.5.1
    Source code(tar.gz)
    Source code(zip)
  • 4_1_41(Dec 23, 2022)

    fix: write date/time matchers in the correct format as per the spec

    • 00ce37524 - fix: write date/time matchers in the correct format as per the spec #1617
    • f825173f7 - chore: Upgrade Gradle to 6.4.1
    • aba556c35 - fix: Update matching rule loading code to support correct + incorrect formatted date/time matchers #1617
    Source code(tar.gz)
    Source code(zip)
  • 4_5_0-beta_0(Dec 14, 2022)

    Support for plugin GenerateContentRequest

    • ccaf27ee9 - feat: Add support for plugin GenerateContentRequest
    • 6acc512d1 - chore: Upgrade Kotlin to 1.7.22 and plugin driver to 0.2.0
    • 1b1579ff2 - chore: Upgrade Gradle to 7.6
    • c9a62cc8d - refactor: performance improvements in core/matchers module (Matchers, Matching, CollectionUtils) (Tomasz Linkowski)
    • 21af9f54b - refactor: add missing test case for #1347 (Tomasz Linkowski)
    • 102e67362 - bugfix: fix custom header propagation in list case (Artem Ptushkin)
    Source code(tar.gz)
    Source code(zip)
  • 4_1_40(Nov 25, 2022)

    Fixes back-ported from v4.3.x

    • f449da53a - feat: protect json body generation against loop for cicly reference (Samuel)
    • e256c0cd8 - feat: support MessagePact with a string as a content #1619
    • 68dd07fa3 - feat: Support system properties or environment variables for consumer and provider annotation with JUnit4 provider tests #528 #1616
    • 28ff52287 - fix: queryMatchingDatetime creates invalid genetator #1612
    • aece98db3 - fix: write empty bodies to the Pact file #1611
    • 7083f8c06 - feat: add capability to build json body based on data class required constructor fields (Samuel)
    • d1afb8e97 - bump actions/setup-java to v3 (Nikolas Grottendieck)
    • b937ccb79 - bump org.json:json version to latest (Nikolas Grottendieck)
    • c8698523a - chore: Update the HAL client to return the current navigated document
    • 6f3c42232 - Use Thread Context ClassLoader to find test resources (Holly Cummins)
    • 369033589 - Bump version of Kotlin Result to work around Unresolved reference build failures (Holly Cummins)
    • ba2cf791c - Fix issue with base classes (Stefano Lucka)
    • 92dca3b3a - feat: update docs on providing raw selector JSON
    • 728ed95dc - feat: add capability to the selector builder DSL to add raw JSON snippets
    • bd4289975 - fix(Gradle): publishing pacts - default to the consumer version system property if it is set #1601
    • d0b4051e4 - chore: fix publishing Gradle plugin to Maven Central #1588
    • 041e69b14 - feat: add example JUnit4 Spring test using new consumer version selector method
    • a601f18c8 - feat: Add docs for using consumer version selector methods with JUnit4
    • dcfdb6a8b - fix: raise an exception when the consumerVersionSelectors method has the wrong signature #1594
    • e924d807c - fix: allways apply the plugin-publish plugin to the Gradle plugin project #1588
    • fc9fb3b40 - Consumer version selector method must be public (Stefano Lucka)
    • 52df11566 - Replace diff-utils with the latest actively maintained version 4.12 (Bernard Fugas)
    Source code(tar.gz)
    Source code(zip)
  • 4_4_2(Nov 22, 2022)

  • 4_4_1(Nov 21, 2022)

    Bugfix Release - fix dependency issues

    • 7913c0e0c - fix: remove kotlin-logging from the convention plugin project constraints #1639
    • 32852036f - fix: com.michael-bull.kotlin-result was causing dependency issues #1639
    • d9eff8f3f - fix: correct the kotlin-logging dependency
    Source code(tar.gz)
    Source code(zip)
  • 4_4_0(Nov 18, 2022)

    4.4.0 Release

    • e273b2ebc - fix: Upgrade plugin driver to 0.1.7 (fixes startMockServer doesn't set hostInterface, port, and tls)
    • 96eca26df - chore: remove beta from version
    Source code(tar.gz)
    Source code(zip)
  • 4_4_0-beta_8(Nov 16, 2022)

    Fixes from master

    • 0338f438c - chore: Upgrade Gradle to 7.5.1 and convert the project to use convention plugins
    • 2b9b18bda - chore: add simple JSON builder
    • da6efdec9 - GH-1632 invent default auth header with additional tests (Artem Ptushkin)
    • 532beabab - refactor: Convert ANTLR MatchingRuleDefinition parser to a recursive decent parser #1615
    • 2d730c799 - refactor: Convert ANTLR TimeExpression parser to a recursive decent parser #1615
    • 5d78360b2 - refactor: Convert ANTLR DateExpression parser to a recursive decent parser #1615
    • 739a40dd3 - refactor: extract common lexer functions from version parser #1615
    • 4d7a28bbf - fix: replace AssertJ with Hamcrest
    • b4ff3a854 - feat: protect json body generation against loop for cicly reference (Samuel)
    • 47e8c9e63 - refactor: Replace ANTLR version parser with a recursive decent parser #1615
    • 7e2e11aaf - chore: Upgrade all test dependencies with reported CSVs #1626
    • 4cf345f31 - chore: Upgrade Spock to 2.3
    • 625cdfc1c - chore: Upgrade all dependencies with reported CSVs #1626
    • 72f9193ba - feat: add method to setup content type body matching in the consumer DSL #1623
    • 8bd14d589 - feat: support MessagePact with a string as a content #1619
    • 86813ba68 - feat: Support system properties or environment variables for consumer and provider annotation with JUnit4 provider tests #528 #1616
    • aabee8c44 - fix: queryMatchingDatetime creates invalid genetator #1612
    • 2750d8a8e - chore: add Kotlin Junit5 message test
    • fc7e13e87 - fix: write empty bodies to the Pact file #1611
    • 870a99956 - feat: Support generators with URI FORM encoded bodies #1610
    • 719f07b9b - feat: add capability to build json body based on data class required constructor fields (Samuel)
    • d1e76e376 - Make PactVerificationTask as much ready as possible for configuration cache (Marco Gomiero)
    • 1fd9c0901 - bump actions/setup-java to v3 (Nikolas Grottendieck)
    • 0a804b139 - bump org.json:json version to latest (Nikolas Grottendieck)
    • 0a23caba1 - Make PactCanIDeployTask compatible with Gradle Configuration Cache (Marco Gomiero)
    • e3dd8bf5d - Make PactPublishTask compatible with Gradle Configuration Cache (Marco Gomiero)
    Source code(tar.gz)
    Source code(zip)
  • 4_3_17(Nov 14, 2022)

  • 4_3_16(Oct 28, 2022)

    Bugfix Release

    • 532beabab - refactor: Convert ANTLR MatchingRuleDefinition parser to a recursive decent parser #1615
    • 2d730c799 - refactor: Convert ANTLR TimeExpression parser to a recursive decent parser #1615
    • 5d78360b2 - refactor: Convert ANTLR DateExpression parser to a recursive decent parser #1615
    • 739a40dd3 - refactor: extract common lexer functions from version parser #1615
    • b4ff3a854 - feat: protect json body generation against loop for cicly reference (Samuel)
    • 47e8c9e63 - refactor: Replace ANTLR version parser with a recursive decent parser #1615
    • 7e2e11aaf - chore: Upgrade all test dependencies with reported CSVs #1626
    • 4cf345f31 - chore: Upgrade Spock to 2.3
    • 625cdfc1c - chore: Upgrade all dependencies with reported CSVs #1626
    • 72f9193ba - feat: add method to setup content type body matching in the consumer DSL #1623
    • 8bd14d589 - feat: support MessagePact with a string as a content #1619
    • 86813ba68 - feat: Support system properties or environment variables for consumer and provider annotation with JUnit4 provider tests #528 #1616
    • aabee8c44 - fix: queryMatchingDatetime creates invalid genetator #1612
    • fc7e13e87 - fix: write empty bodies to the Pact file #1611
    • 870a99956 - feat: Support generators with URI FORM encoded bodies #1610
    • 719f07b9b - feat: add capability to build json body based on data class required constructor fields (Samuel)
    • d1e76e376 - Make PactVerificationTask as much ready as possible for configuration cache (Marco Gomiero)
    • 0a804b139 - bump org.json:json version to latest (Nikolas Grottendieck)
    • 0a23caba1 - Make PactCanIDeployTask compatible with Gradle Configuration Cache (Marco Gomiero)
    • e3dd8bf5d - Make PactPublishTask compatible with Gradle Configuration Cache (Marco Gomiero)
    Source code(tar.gz)
    Source code(zip)
  • 4_4_0-beta_6(Oct 11, 2022)

    Maintenance Release

    • ccca23c95 - fix: Upgrade plugin driver to 0.1.6 (fixes plugin loading with multiple versions of the same plugin)
    • 3d9bcedf2 - chore: Update the HAL client to return the current navigated document
    • 205bbd341 - chore: fix for 'compileTestJava' task (current target is 18) and 'compileTestKotlin' task (current target is 11) jvm target compatibility should be set to the same Java version
    • 6a53c7f68 - chore: Bump Antlr4 to 4.11.1 #1609 (Alex Miller)
    • 873b0e5b3 - Use Thread Context ClassLoader to find test resources #1607 (Holly Cummins)
    • 50863b9f6 - Bump version of Kotlin Result to work around Unresolved reference build failures #1606 (Holly Cummins)
    • db962337e - Fix issue with base classes (Stefano Lucka)
    • 11811508c - fix: PactBuilder was not correctly setting up HTTP interaction given a Map structure
    Source code(tar.gz)
    Source code(zip)
  • 4_3_15(Sep 30, 2022)

    Bugfix Release

    • 3d9bcedf2 - chore: Update the HAL client to return the current navigated document
    • 205bbd341 - chore: fix for 'compileTestJava' task (current target is 18) and 'compileTestKotlin' task (current target is 11) jvm target compatibility should be set to the same Java version
    • 6a53c7f68 - chore: Bump Antlr4 to 4.11.1 (Alex Miller)
    • 873b0e5b3 - Use Thread Context ClassLoader to find test resources (Holly Cummins)
    • 50863b9f6 - Bump version of Kotlin Result to work around Unresolved reference build failures (Holly Cummins)
    • db962337e - Fix issue with base classes (Stefano Lucka)
    • d31b3e6f4 - feat: update docs on providing raw selector JSON
    • 416b19d23 - feat: add capability to the selector builder DSL to add raw JSON snippets
    • fa7d27065 - fix(Gradle): publishing pacts - default to the consumer version system property if it is set #1601
    • 67204596b - chore: fix publishing Gradle plugin to Maven Central #1588
    • 08bb852a3 - feat: add matching functions to consumer DSL to matcher numbers with a regex #1600
    • 7580b4599 - Adding Lambda DSL variants for request/response (Zabuzard)
    Source code(tar.gz)
    Source code(zip)
  • 4_4_0-beta_4(Aug 15, 2022)

    Fixes from master + fix for tests using gRPC plugin

    • e4d37b9a8 - fix Upgrade plugin driver to 0.1.5
    • 9a1c9c3cf - fix: Upgrade plugin driver to 0.1.4. Supports plugins that use IP4 addresses
    • cfc6e3893 - fix: support consumer version selector methods on Kotlin test classes #1594
    • d56079c0d - fix: raise an exception when the consumerVersionSelectors method has the wrong signature #1594
    • 4ee099dae - Updated kotlin version from 1.5.31 to 1.6.21 (Jaswanth)
    • 561f0428d - fix: always apply the plugin-publish plugin to the Gradle plugin project #1588
    • 37de1f298 - Consumer version selector method must be public (Stefano Lucka)
    • 18832534b - Replace diff-utils with the latest actively maintained version 4.12 (Bernard Fugas)
    • b85250936 - fix(Gradle): fixes gradle provider verification from pact file #1587
    • d7ec72411 - fix(Gradle): Update methods on GradleProviderInfo to support calling hasPactsFromPactBroker without options #1586
    Source code(tar.gz)
    Source code(zip)
  • 4_3_14(Aug 12, 2022)

    Bugfix Release

    • ddf7d794b - feat: add example JUnit4 Spring test using new consumer version selector method
    • 09d907b79 - feat: Add docs for using consumer version selector methods with JUnit4
    • 1a7952908 - chore: Update readme with updated Kotlin version
    • cfc6e3893 - fix: support consumer version selector methods on Kotlin test classes #1594
    • d56079c0d - fix: raise an exception when the consumerVersionSelectors method has the wrong signature #1594
    • 4ee099dae - Updated kotlin version from 1.5.31 to 1.6.21 (Jaswanth)
    • 561f0428d - fix: allways apply the plugin-publish plugin to the Gradle plugin project #1588
    • 5ef6270da - chore: move PactBrokerLoaderSpec to provider test source
    • 510c48482 - chore: Correct JUnit 5 readme
    • 37de1f298 - Consumer version selector method must be public (Stefano Lucka)
    • 18832534b - Replace diff-utils with the latest actively maintained version 4.12 (Bernard Fugas)
    Source code(tar.gz)
    Source code(zip)
  • 4_1_39(Aug 2, 2022)

    Back-ported fixes and consumer version selectors from v4.3.x

    • d7fccb6c5 - fix(Gradle): fixes gradle provider verification from pact file #1587
    • 77b79a2cd - fix(Gradle): Update methods on GradleProviderInfo to support calling hasPactsFromPactBroker without options #1586
    • 14a51438a - fix: for NoSuchMethodError: void kotlin.jvm.internal.FunctionReferenceImpl
    • 05dce3c05 - feat: Update Maven plugin readme with latest consumer version selectors
    • 34d19e3c7 - feat: Update Maven plugin with latest consumer version selectors
    • 7177bdcee - chore: remove deprecation annotation from selector tag methods
    • 1a5195785 - fix: annotation check was failing on JDK8
    • d23fcbe97 - refactor: rename ConsumerVersionSelectors annotation so it does not clash with the model class
    • 17e51e32f - refactor: Consumer Version Selectors method does not need a parameter
    • 743ac4baa - Feat: Support consumer version selectors DSL for JUnit 5
    • f54ee01df - feat(JUnit): allow pact loader to setup from the test class instead of just annotations
    • afeca4007 - chore: correct the GitHub URL in Gradle plugin
    • 957f3a3e2 - chore: upgrade Gradle project to use 1.0 of the plugin-publish plugin
    • f021ef1f9 - feat: add Gradle DSL functions for deprecated tag forms of selectors
    • fe643c961 - fix: call the updated selector method from the Gradle plugin
    • 0afc9543d - Feat: Implement new Gradle DSL for consumer version selectors
    • 01e45dcc8 - feat: allow consumer version selector JSON to be provided with an environment variable
    • 57533e350 - Update gradle.properties to fix Vulnerability
    • 33d659e1d - Added secondary constructor to FormPostBuilder to facilitate passing a ContentType.
    • 8a6095c06 - chore: correct offset expressions in date-time expressions
    • a36ce7740 - chore: correct message on warning log entry
    • e0b15ab24 - Update PactCanIDeployTask.groovy
    • 1a80e41ae - Adding support for Kafka Schema Registry JSON messages. Do not store magic bytes in broker: - use the content-type to add them to messages for Consumer Tests - remove first 5 bytes from provider tests before parsing as JSON
    • b48e37daf - feat: Add support for PactLoader path value expressions
    • 270808af6 - Adding support for Kafka Schema Registry JSON messages. Utilise the Content-Type to indicate KSR messages. Deal with the 5 "magic" bytes at the start of the JSON.
    • 8dc11bd4c - fix: make the use of content type overrides consistent #1569
    • 1f2cf91a1 - docs: link to 'Using provider states effectively'
    • 3e09e6c54 - feat: allow consumer version selector JSON to be provided with an environment variable
    • bec44aa39 - fix: make the use of content type overrides consistent #1569
    Source code(tar.gz)
    Source code(zip)
  • 4_3_13(Jul 31, 2022)

    Bugfix Release

    • b85250936 - fix(Gradle): fixes gradle provider verification from pact file #1587
    • d7ec72411 - fix(Gradle): Update methods on GradleProviderInfo to support calling hasPactsFromPactBroker without options #1586
    • 0bc7cdfe5 - chore: upgrade plugin-publish Gradle plugin to 1.0.0
    Source code(tar.gz)
    Source code(zip)
  • 4_4_0-beta_3(Jul 27, 2022)

    Merged all changes from master

    • 0bc7cdfe5 - chore: upgrade plugin-publish Gradle plugin to 1.0.0
    • ad812c438 - feat: add support for LocalDate to LambdaDslObject #1530
    • d914ff1d3 - fix: pass the value resolver on to the PactVerificationContext, fixes issues with Spring tests #1572
    • c085da667 - fix: pass consumer.pending through when validating an async message interaction #1573
    • fe762dc9c - fix: support multipart form posts with multiple parts #1574
    • 67b2a8c1e - chore: add example test with negative numbers #1575
    • 021c0c7e7 - fix: support multi-line matching with plain text matcher #1579
    • 2a0f97761 - fix: for NoSuchMethodError: void kotlin.jvm.internal.FunctionReferenceImpl
    • 6c60109c3 - feat: Update Maven plugin readme with latest consumer version selectors
    • d46c317d3 - feat: Update Maven plugin with latest consumer version selectors
    • 8d33dc9e5 - chore: Upgrade Kotlin to 1.6.21
    • 84337cea7 - chore: remove deprecation annotation from selector tag methods
    • a47176118 - refactor: rename ConsumerVersionSelectors annotation so it does not clash with the model class
    • 8335063df - fix: correct publish config to work with Gradle 7
    • 471c13e8f - refactor: Consumer Version Selectors method does not need a parameter
    • f37c1379f - Feat: Support consumer version selectors DSL for JUnit 5
    • 3932b2456 - feat(JUnit): allow pact loader to setup from the test class instead of just annotations
    • 7b739a19f - chore: correct the GitHub URL in Gradle plugin
    • cb3d021f2 - docs: Update Gradle readme with branches and releases support (Ronald Holshausen, Tue Jun 28 15:17:44 2022 +1000)
    • 0c066254d - chore: upgrade Gradle project to use 1.0 of the plugin-publish plugin
    • ba88e3019 - feat: add Gradle DSL functions for deprecated tag forms of selectors
    • 60712c465 - fix: call the updated selector method from the Gradle plugin
    • f927119bf - Feat: Implement new Gradle DSL for consumer version selectors
    • 5acf7d226 - refactor(Gradle): use delegation instead of inheritance to allow supporting Gradle 8 changes
    • 832718413 - feat(Gradle): Add auth option for no auth
    • d8f7ee3f6 - docs: add raw JSON property description
    • de753fc2f - feat: allow consumer version selector JSON to be provided with an environment variable
    • 0fa5b5eae - fix: make the use of content type overrides consistent #1569
    • 0e411319e - chore: add example tests with attributes that contain slashes #1556
    • 39d3739f1 - fix: providerVersionBranch for pending pacts (Praveen Erode Mohanasundaram)
    • 601d49f76 - chore: Included githubactions in the dependabot config (nathannaveen)
    • 6e4b18002 - Updating build.gradle to fix Vulnerability CVE-2022-22970 (Colin)
    • 936ac74c3 - Add support for providerVersionBranches #1554 (Ben Pilgrim)
    • 37ba29941 - Updating build.gradle to fix vulnerability (rejeeshg)
    • c5df12d0e - Update gradle.properties to fix Vulnerability (rejeeshg)
    • 099d6cf4b - Update build.gradle to mitigate Vuln CVE-2022-22965 (rejeeshg)
    Source code(tar.gz)
    Source code(zip)
  • 4_3_12(Jul 26, 2022)

    Bugfixes + Update Maven plugin with latest consumer version selectors

    • ad812c438 - feat: add support for LocalDate to LambdaDslObject #1530
    • d914ff1d3 - fix: pass the value resolver on to the PactVerificationContext, fixes issues with Spring tests #1572
    • c085da667 - fix: pass consumer.pending through when validating an async message interaction #1573
    • fe762dc9c - fix: support multipart form posts with multiple parts #1574
    • 67b2a8c1e - chore: add example test with negative numbers #1575
    • 021c0c7e7 - fix: support multi-line matching with plain text matcher #1579
    • 2a0f97761 - fix: for NoSuchMethodError: void kotlin.jvm.internal.FunctionReferenceImpl
    • 6c60109c3 - feat: Update Maven plugin readme with latest consumer version selectors
    • d46c317d3 - feat: Update Maven plugin with latest consumer version selectors
    • 84337cea7 - chore: remove deprecation annotation from selector tag methods
    Source code(tar.gz)
    Source code(zip)
  • 4_3_11(Jul 6, 2022)

    Support consumer version selectors DSL for JUnit 5

    • a47176118 - refactor: rename ConsumerVersionSelectors annotation so it does not clash with the model class
    • 8335063df - fix: correct publish config to work with Gradle 7
    • 0ccc32dd2 - feat: Update JUnit 5 readme with Consumer Version Selectors DSL
    • 79b0038c3 - feat: Update JUnit 5 readme with Consumer Version Selectors DSL
    • d50014ce2 - feat: Update JUnit 5 readme with Consumer Version Selectors DSL
    • 471c13e8f - refactor: Consumer Version Selectors method does not need a parameter
    • f37c1379f - Feat: Support consumer version selectors DSL for JUnit 5
    • 3932b2456 - feat(JUnit): allow pact loader to setup from the test class instead of just annotations
    • cb3d021f2 - docs: Update Gradle readme with branches and releases support
    Source code(tar.gz)
    Source code(zip)
  • 4_3_10(Jun 28, 2022)

    Supports branches and releases with Gradle plugin

    • ba88e3019 - feat: add Gradle DSL functions for deprecated tag forms of selectors
    • f927119bf - Feat: Implement new Gradle DSL for consumer version selectors
    • 5acf7d226 - refactor(Gradle): use delegation instead of inheritance to allow supporting Gradle 8 changes
    • 832718413 - feat(Gradle): Add auth option for no auth
    • de753fc2f - feat: allow consumer version selector JSON to be provided with an environment variable
    • 0fa5b5eae - fix: make the use of content type overrides consistent #1569
    • 7a2a77b56 - docs: link to 'Using provider states effectively' #1571 (Édouard Lopez)
    • 0e411319e - chore: add example tests with attributes that contain slashes #1556
    Source code(tar.gz)
    Source code(zip)
  • 4_3_9(May 31, 2022)

    Rename pactbroker.providerBranches to pactbroker.providerBranch [Breaking Change]

    Breaking Change: This release renames providerBranches to providerBranch introduced in 4.3.8

    • 39d3739f1 - fix: providerVersionBranch for pending pacts (Praveen Erode Mohanasundaram)
    • 6e4b18002 - Updating build.gradle to fix Vulnerability CVE-2022-22970 (Colin)
    Source code(tar.gz)
    Source code(zip)
  • 4_1_38(May 31, 2022)

    Rename pactbroker.providerBranches to pactbroker.providerBranch [Breaking Change]

    Breaking Change: This release renames providerBranches to providerBranch introduced in 4.1.37

    • a37409b23 - fix: providerVersionBranch for pending pacts (Praveen Erode Mohanasundaram)
    • d68690790 - Updating build.gradle to fix Vulnerability CVE-2022-22970 (Colin)
    Source code(tar.gz)
    Source code(zip)
  • 4_3_8(May 26, 2022)

  • 4_1_37(May 26, 2022)

  • 4_3_7(May 13, 2022)

    Maintenance Release

    • 37ba29941 - Updating build.gradle to fix vulnerability #1550 (rejeeshg)
    • c5df12d0e - Update gradle.properties to fix Vulnerability #1546 (rejeeshg)
    • 099d6cf4b - Update build.gradle to mitigate Vuln CVE-2022-22965 #1544 (rejeeshg)
    • abee6c3e5 - feat: Add support for enabling insecure TLS to the PactBrokerLoader. #1531 (Colin Anderson)
    • f169bcba0 - chore: Update project to run on JDK 17
    Source code(tar.gz)
    Source code(zip)
  • 4_2_21(May 13, 2022)

    Maintenance Release

    • 0d5b8f5de - chore: Upgrade JUnit 5 to 5.8.2
    • d29710333 - Update gradle.properties to fix Vulnerability issue #1552 (rejeeshg)
    • 2ff4a3ab2 - Upgrade build.gradle to mitigate Vulnerability #1549 (rejeeshg)
    • 12ac2833f - Update build.gradle to mitigate Vulnerabilities from dependencies: CVE-2022-22965 #1543 (rejeeshg)
    Source code(tar.gz)
    Source code(zip)
  • 4_1_36(May 13, 2022)

    Maintenance Release

    • a90d0e903 - Updating build.gradle to fix Vulnerability #1551 (rejeeshg)
    • 548012cb2 - Update gradle.properties to fix Vulnerability #1548 (rejeeshg)
    • d67ab750f - Update build.gradle #1542 (rejeeshg)
    Source code(tar.gz)
    Source code(zip)
  • 4_4_0-beta_2(Apr 27, 2022)

  • 4_1_35(Apr 19, 2022)

    Bugfix Release

    • fdf0a5e90 - fix: PactCanIDeployTask needs to have internal fields maked @Internal for Gradle 7 #1430
    • c3ea56917 - feat: Add support for enabling insecure TLS to the PactBrokerLoader. (Colin Anderson)
    Source code(tar.gz)
    Source code(zip)
Owner
Pact Foundation
The cross-language distributed contract testing framework.
Pact Foundation
Java testing framework for testing pojo methods

Java testing framework for testing pojo methods. It tests equals, hashCode, toString, getters, setters, constructors and whatever you report in issues ;)

Piotr Joński 48 Aug 23, 2022
State of the art mutation testing system for the JVM

Pitest (aka PIT) is a state of the art mutation testing system for Java and the JVM. Read all about it at http://pitest.org Releases 1.7.3 #952 Mutate

Henry Coles 1.5k Dec 26, 2022
Utility to automatically manage all web element waits and enables to write wait-free selenium tests.

selenium-auto-wait selenium-auto-wait automatically manages all weblement waits and makes you to write wait free selenium tests. Features Waits till e

Sudharsan Selvaraj 31 Nov 1, 2022
MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Rub

MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby. MockServer also includes a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding).

Mock-Server 4k Jan 4, 2023
Behavior-Driven Development in plain Java

JGiven is a developer-friendly and pragmatic BDD tool for Java. Developers write scenarios in plain Java using a fluent, domain-specific API, JGiven g

TNG Technology Consulting GmbH 393 Dec 23, 2022
Java (and original) version of Hamcrest

Java Hamcrest Licensed under BSD License. What is Hamcrest? Hamcrest is a library of matchers, which can be combined in to create flexible expressions

Hamcrest 2k Jan 5, 2023
Version informatisée du jeu "Citadelles"

?? projet2-ps5-21-22-ps5-21-22-projet2-b : Projet Citadelles Membres de l'équipe Florian Latapie Loïc Le Bris Marius Lesaulnier Thomas Paul Descriptio

Florian Latapie 3 Dec 8, 2022
Toolkit for testing multi-threaded and asynchronous applications

ConcurrentUnit A simple, zero-dependency toolkit for testing multi-threaded code. Supports Java 1.6+. Introduction ConcurrentUnit was created to help

Jonathan Halterman 406 Dec 30, 2022
Java DSL for easy testing of REST services

Testing and validation of REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of usi

REST Assured 6.2k Dec 31, 2022
Cucumber DSL for testing RESTful Web Services

cukes-rest takes simplicity of Cucumber and provides bindings for HTTP specification. As a sugar on top, cukes-rest adds steps for storing and using r

C.T.Co 100 Oct 18, 2022
A modern testing and behavioural specification framework for Java 8

Introduction If you're a Java developer and you've seen the fluent, modern specification frameworks available in other programming languages such as s

Richard Warburton 250 Sep 12, 2022
Randomized Testing (Core JUnit Runner, ANT, Maven)

RANDOMIZED TESTING ================== JUnit test runner and plugins for running JUnit tests with pseudo-randomness. See the following for more infor

null 167 Dec 26, 2022
Captures log entries for unit testing purposes

LogCaptor Install with maven <dependency> <groupId>io.github.hakky54</groupId> <artifactId>logcaptor</artifactId> <version>2.4.0</version>

null 215 Jan 1, 2023
A programmer-oriented testing framework for Java.

JUnit 4 JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. For more infor

JUnit 8.4k Jan 4, 2023
The Enterprise-ready testing and specification framework.

Spock Framework Spock is a BDD-style developer testing and specification framework for Java and Groovy applications. To learn more about Spock, visit

Spock Framework 3.3k Jan 5, 2023
TestNG testing framework

Documentation available at TestNG's main web site. Release Notes 7.4.0 7.3.0 7.1.0 7.0.0 Need help? Before opening a new issue, did you ask your quest

Cedric Beust 1.8k Jan 5, 2023
Layout and functional testing framework for websites

Galen Framework master: Galen is an open-source tool for testing layout and responsive design of web applications. It is also a powerfull functional t

Galen Framework 1.4k Dec 10, 2022
Java DSL for easy testing of REST services

Testing and validation of REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of usi

REST Assured 6.2k Dec 25, 2022