Home > Enterprise >  Pact verify not publishing result to pact broker
Pact verify not publishing result to pact broker

Time:06-25

I was successful to publish the contract in pact JS to Pact broker and now am trying to verify the contract in Java spring boot, the contract verification pass with no issues but the result of that verification doesn't get published to Pact broker which leaves the contact on Pactflow unverified, here is the plugin I am using

             <plugin>
                <groupId>au.com.dius.pact.provider</groupId>
                <artifactId>maven</artifactId>
                <version>4.1.11</version>
                <configuration>
                    <serviceProviders>
                        <serviceProvider>
                            <name>UsersService</name>
                            <pactBroker>
                                <url>--myPactFlowURL--</url>
                                <authentication>
                                    <scheme>bearer</scheme>
                                    <token>--myTOKEN--</token>
                                </authentication>
                            </pactBroker>
                        </serviceProvider>
                    </serviceProviders>
                </configuration>
            </plugin>

I run mvn pact:verify and I get this:

Given Add user
     WARNING: State Change ignored as there is no stateChange URL
request for adding user
returns a response which
  has status code 201 (OK)
  has a matching body (OK)

for every interaction in the contract and there are a lot of them for everyone I get that warning but everything passes OK and lastly, I get this NOTE:

NOTE: Skipping publishing of verification results as it has been disabled (pact.verifier.publishResults is not 'true')

CodePudding user response:

I tried changing this system property pact.verifier.publishResults multiple ways. I tried running my verify command with this mvn pact:verify -Dpact.verifier.publishResults='true' I also tried setting it up in maven-surefire-plugin, but still nothing worked.

In the end here is what worked for me, in my pact.provider plugin I added a separate configuration block, other than the one where I set my pact broker parameter in here is what that configuration block looks like:

<configuration>                        
   <pact.verifier.publishResults>true</pact.verifier.publishResults>
</configuration>
  • Related