Hi , I am getting below error while running the pr...
# pact-jvm
a
Hi , I am getting below error while running the provider test but the consumer test are successful and pact is published to pact broker. I am using Token mechanism
u
401 Unauthenticated response means your credentials are not correct. What Pact broker are you connecting to?
m
Are you using Pactflow or the open source broker? Pactflow uses the token mechanism, but for the OSS it’s likely a username/password combination
a
my credentials are correct. I am using pactflow and using the read/write token. If i pass the token in the Java class it is getting accepted but if i do from mvn it is not getting accepted
Copy code
<pact.version>4.1.28</pact.version>
below is my maven command mvn clean test -PproducerContractTestWithBroker \ -Dpact.broker.url="https://x.pactflow.io/" \ -Dpact.broker.token="xxxxxxx" \ -Dpact.verifier.publishResults=true
I solved it. i was not setting the token in systemPropertyVariables of surefire. By setting there, it worked
👍 1