Pact Provider Exception when no pacts to verify
See original GitHub issueHello,
I’m implementing Pact Provider Junit5 and I’m facing this issue whenever there is no pacts available to verify for this provider (when there is, it works like a charm). I’m using version 3.5.21.
This is the implementation :
@Provider("myprovider")
@PactBroker(host="${pact.broker.host}", port = "${pact.broker.port}",tags = "${pact.broker.tag}")
@IgnoreNoPactsToVerify
public class PactVerifyITTest {
@TestTemplate
@ExtendWith(PactVerificationInvocationContextProvider.class)
void testTemplate(Pact pact, Interaction interaction, HttpRequest request, PactVerificationContext context) {
context.verifyInteraction();
}
And the exception raised when not pacts are available:
...
16:11:11.110 [main] DEBUG org.apache.http.wire - http-outgoing-1 << "{"_links":{"self":{"href":"http://192.168.99.100:30003/pacts/provider/myprovider/latest/dev","title":"Latest pact versions for the provider myprovider with consumer version tag 'dev'"},"provider":{"href":"http://192.168.99.100:30003/pacticipants/myprovider","title":"myprovider"},"pb:pacts":[],"pacts":[]}}"
16:11:11.110 [main] DEBUG org.apache.http.headers - http-outgoing-1 << HTTP/1.1 200 OK
16:11:11.110 [main] DEBUG org.apache.http.headers - http-outgoing-1 << Content-Type: application/hal+json;charset=utf-8
16:11:11.110 [main] DEBUG org.apache.http.headers - http-outgoing-1 << Content-Length: 322
16:11:11.110 [main] DEBUG org.apache.http.headers - http-outgoing-1 << Connection: keep-alive
16:11:11.110 [main] DEBUG org.apache.http.headers - http-outgoing-1 << Status: 200 OK
16:11:11.110 [main] DEBUG org.apache.http.headers - http-outgoing-1 << Date: Tue, 11 Sep 2018 14:10:53 GMT
16:11:11.110 [main] DEBUG org.apache.http.headers - http-outgoing-1 << X-Content-Type-Options: nosniff
16:11:11.110 [main] DEBUG org.apache.http.headers - http-outgoing-1 << Server: Webmachine-Ruby/1.5.0 Rack/1.3
16:11:11.110 [main] DEBUG org.apache.http.headers - http-outgoing-1 << X-Pact-Broker-Version: 2.23.3
16:11:11.110 [main] DEBUG org.apache.http.headers - http-outgoing-1 << X-Powered-By: Phusion Passenger 5.1.11
16:11:11.110 [main] DEBUG o.a.h.impl.execchain.MainClientExec - Connection can be kept alive indefinitely
16:11:11.111 [main] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection [id: 1][route: {}->http://192.168.99.100:30003] can be kept alive indefinitely
16:11:11.111 [main] DEBUG o.a.h.i.c.DefaultManagedHttpClientConnection - http-outgoing-1: set socket timeout to 0
16:11:11.111 [main] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection released: [id: 1][route: {}->http://192.168.99.100:30003][total kept alive: 1; route allocated: 1 of 5; total allocated: 1 of 10]
org.junit.platform.commons.util.PreconditionViolationException: No supporting TestTemplateInvocationContextProvider provided an invocation context
Did I miss something possibly? or is it an issue ? Thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Pact Provider Exception when no pacts to verify #768 - GitHub
This is a problem with JUnit 5. The pact library is doing the correct thing, but then as there are no pacts, there...
Read more >No Pact files were found to verify - Stack Overflow
I tried to rename the provider in publisher side and use it with new name, still same issue. Pacts on server: enter image...
Read more >Pact junit runner | Pact Docs
By default, the pact runner will verify all pacts for the given provider. You can filter the pacts and interactions by the following...
Read more >PACT JVM Example | ArXmanS
Publish Pacts to Pact Broker; 2.4. Run the Contract Test at Provider side. 3. Gradle Configuration; 4. Contract Test between Provider and Consumer...
Read more >Consumer Tests with Pact, Junit5, SpringBoot - Level Up Coding
This verification is provided by the Pact framework, and allows independent testing of the consumer and provider without having to integrate both together....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ahsankarimbhai the context will be null when there are no pacts, because the context is created from the pact files. Just check for not null before using the context.
Bad news 😦 It doesn´t work when template method has also an
HttpRequest
parameterIt throws
When this
HttpRequest
is removed logs expectedNo pact found to verify
Any thoughts?