Open davidvc opened 2 years ago
We're using version 4.2.9 of the JVM libraries from Pact:
<dependency>
<groupId>au.com.dius.pact.consumer</groupId>
<artifactId>junit</artifactId>
<version>4.2.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>au.com.dius.pact.provider</groupId>
<artifactId>junit5</artifactId>
<version>4.2.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>au.com.dius.pact.provider</groupId>
<artifactId>spring</artifactId>
<version>4.2.9</version>
<scope>test</scope>
</dependency>
For example here's some output during mvn test
:
21:25:28 [ERROR] Failed to fetch the root HAL document: Request to path '/' failed with response 'HTTP/1.1 401 Unauthorized' -> [Help 1]
In the Pact JVM documentation, it says that the system property
pactbroker.auth.token
can be passed in as an environment variable as well as a JVM system property.But when we try using just an environment variable, the token is not picked up and when we talk to the broker we get a 401 unauthorized.
We have to explicitly pass it in to the maven command using
-Dpactbroker.auth.token=<token>
, and then it works.