Hi, I have created couple of consumer tests using ...
# pact-jvm
r
Hi, I have created couple of consumer tests using Junit5, they pass and generate pacts also, but when I run either of them, I get this error at class level
java.lang.AssertionError: The following methods annotated with @Pact were not executed during the test: RulesApiConsumerTest.createPactFor200
If these are currently a work in progress, add a @Disabled annotation to the method
I don't see this error when I run them together I have also used
PactTestFor
to categorize the tests with their respective method inside my test class
r
If you only run one test, the pact method for the other test won't be run, so you will get that error.
r
so should I have separate class for each test ?
r
That's one way to do it. It just ignore that error if you only run one test (I assume this is from your IDE)
r
Yes
Is there any anotation to ignore that error ?
What if I run the tests on pipeline ?
I won't see them ?
r
I mean just ignore that the error occurred. You know it is ok because you can run all the tests just fine.
r
Okay