0

I am using JUnit for generating Pacts and Pacts maven plugin to post the pact into pact broker. I am using below plugin Configuration

        <plugin>
            <groupId>au.com.dius</groupId>
            <artifactId>pact-jvm-provider-maven_2.11</artifactId>
            <version>3.3.9</version>
            <configuration>
                <projectVersion>2.0</projectVersion>
                <pactBrokerUrl>https:example.com</pactBrokerUrl>
                <pactBrokerUsername>username1</pactBrokerUsername>
                <pactBrokerPassword>password1</pactBrokerPassword>
                <trimSnapshot>true</trimSnapshot> <!-- Defaults to false -->
            </configuration>
        </plugin>

While Consumenr pact is getting uploaded in broker, I am able to see only single entry of consumer pact of version 2.0. Eirlier I have uploaded version 1.0 eirlier, which is not present in the UI. Is there any way to see the multiple version of same provider pact in HAL browser and get different version of PACTS by Https GET request? Currently I am getting only latest consumenr pact version by http://your-pact-broker/pacts/provider/PROVIDER/consumer/CONSUMER/latest Please provide some info regurding this and let me know if you need any informaiton.

1 Answers1

0

http://your-pact-broker/pacts/provider/PROVIDER/consumer/CONSUMER/versions will show you all the versions of the pact. You can retrieve a pact using the same URL that you used to PUT it to the broker eg. http://your-pact-broker/pacts/provider/PROVIDER/consumer/CONSUMER/version/CONSUMER_VERSION.

You can explore the Pact Broker API using the embedded HAL browser, by clicking the 'HAL browser' link from the index page of the broker.

Beth Skurrie
  • 1,333
  • 7
  • 8
  • One more question, By any chance Can I see these multiple provider pact version in UI or it will always display the latest one. – Shirshendu Saha Jul 29 '17 at 03:47
  • You can view the HTML version of any pact by entering its URL directly into the browser location bar (as distinct from viewing it in the HAL browser). You can also view the diff between a pact and its previous distinct version (ie. the previous one where the content has actually changed) by appending `/diff/previous-distinct` to the pact URL of a specific version. – Beth Skurrie Jul 30 '17 at 23:09
  • Thanks, Beth, It really helps. :) – Shirshendu Saha Aug 02 '17 at 23:11