pact-jvm-provider-junit messaging tests fail when run via maven
See original GitHub issueSee this repo for an example: https://github.com/Fitzoh/pact-jvm-maven-test-issue
If you clone the project and run ProviderMessageTest
through intellij, it will pass.
However, it run run the tests via maven (mvn test
) it fails with the following message:
Verifying a pact between consumer and provider
a test message
Verification Failed - No annotated methods were found for interaction 'a test message'
Failures:
0) a test message
No annotated methods were found for interaction 'a test message'
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.946 sec <<< FAILURE!
consumer - a test message(com.example.ProviderMessageTest) Time elapsed: 0.327 sec <<< FAILURE!
java.lang.AssertionError:
0 - No annotated methods were found for interaction 'a test message'
at au.com.dius.pact.provider.junit.target.BaseTarget.getAssertionError(BaseTarget.java:84)
at au.com.dius.pact.provider.junit.target.AmqpTarget.testInteraction(AmqpTarget.java:51)
at au.com.dius.pact.provider.junit.InteractionRunner$2.evaluate(InteractionRunner.java:181)
at au.com.dius.pact.provider.junit.InteractionRunner.run(InteractionRunner.java:141)
at au.com.dius.pact.provider.junit.PactRunner.runChild(PactRunner.java:101)
at au.com.dius.pact.provider.junit.PactRunner.runChild(PactRunner.java:51)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:7 (2 by maintainers)
Top Results From Across the Web
pact-jvm-provider-junit messaging tests fail when run via maven
If you clone the project and run ProviderMessageTest through intellij, it will pass. However, it run run the tests via maven ( mvn...
Read more >Maven Surefire Plugin – Rerun failing tests
To use this feature through Maven surefire, set the rerunFailingTestsCount property to be a value larger than 0. Tests will be run until...
Read more >Tests fail when executed from maven but not from Intellij
But when I run the tests from maven (either from Intellij or from the command line) they fail. This is my config:
Read more >Why Your JUnit 5 Tests Are Not Running Under Maven
There is a very common issue preventing your JUnit 5 tests from running under Maven. In this post, I explain why and provide...
Read more >4.12. Executing Unit Tests - TheNEXUS | A Community Project
Executing mvn test from the command line caused Maven to execute all ... for details like stack traces and error messages generated by...
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
I was able to run the test with the failsafe maven plugin, by adding the following config to the plugin:
The test failed when being run with the failsafe (or surefire) maven plugins, because the SystemClassLoader returned only the failsafe/surefire booter.jar, when the classpath urls were being retrieved from it (check code in AmqpTarget.java ).
With the configuration in place, the full classpath is being listed through the SystemClassLoader, and therefore the
@PactVerifyProvider
annotations are correctly identified.For more plugin configuration details, check Failsafe Class Loading
@uglyog Thanks 😃 I was able to run it.