Closed TheGitHubGuy1 closed 4 years ago
Just a note, I've tried using the following packages also:
testImplementation "org.junit.jupiter:junit-jupiter-api:5.3.2"
testImplementation "org.mockito:mockito-junit-jupiter:2.22.0"
testImplementation "au.com.dius:pact-jvm-provider-junit5_2.12:3.6.10"
testImplementation "au.com.dius:pact-jvm-consumer-junit5_2.12:3.6.10"
testImplementation "au.com.dius:pact-jvm-consumer-java8_2.12:3.6.10"
With the same result, because I assumed these guys got it working: https://blog.codecentric.de/en/2019/11/message-pact-contract-testing-in-event-driven-applications/ and they were the deps in their gradle.build
Hi,
Not sure if same issue but I'm having problem with consumer HTTP implementation when running gradle task after updating pact to 4.0.6+. Provider tests seems to be working just fine.
java.lang.AssertionError: The following methods annotated with @Pact were not executed during the test: Test1, Test2, Test3
09:18:09.790 [DEBUG] [TestEventLogger] If these are currently a work in progress, and a @Disabled annotation to the method
09:18:09.790 [DEBUG] [TestEventLogger] at au.com.dius.pact.consumer.junit5.PactConsumerTestExt.afterAll(PactConsumerTestExt.kt:350)
09:18:09.790 [DEBUG] [TestEventLogger] at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$invokeAfterAllCallbacks$11(ClassTestDescriptor.java:396)
09:18:09.790 [DEBUG] [TestEventLogger] at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
09:18:09.790 [DEBUG] [TestEventLogger] at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$invokeAfterAllCallbacks$12(ClassTestDescriptor.java:396)
09:18:09.790 [DEBUG] [TestEventLogger] at java.util.ArrayList.forEach(ArrayList.java:1257)
09:18:09.790 [DEBUG] [TestEventLogger] at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.invokeAfterAllCallbacks(ClassTestDescriptor.java:396)
09:18:09.790 [DEBUG] [TestEventLogger] at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.after(ClassTestDescriptor.java:221)
09:18:09.790 [DEBUG] [TestEventLogger] at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.after(ClassTestDescriptor.java:74)
09:18:09.790 [DEBUG] [TestEventLogger] at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:118)
09:18:09.790 [DEBUG] [TestEventLogger] at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
09:18:09.790 [DEBUG] [TestEventLogger] at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:118)
09:18:09.790 [DEBUG] [TestEventLogger] at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:74)
09:18:09.790 [DEBUG] [TestEventLogger] at java.util.ArrayList.forEach(ArrayList.java:1257)
09:18:09.790 [DEBUG] [TestEventLogger] at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
09:18:09.790 [DEBUG] [TestEventLogger] at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$4(NodeTestTask.java:112)
09:18:09.790 [DEBUG] [TestEventLogger] at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
09:18:09.790 [DEBUG] [TestEventLogger] at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:98)
09:18:09.790 [DEBUG] [TestEventLogger] at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:74)
09:18:09.790 [DEBUG] [TestEventLogger] at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
09:18:09.791 [DEBUG] [TestEventLogger] at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
09:18:09.791 [DEBUG] [TestEventLogger] at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
09:18:09.791 [DEBUG] [TestEventLogger] at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
09:18:09.791 [DEBUG] [TestEventLogger] at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
09:18:09.791 [DEBUG] [TestEventLogger] at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
09:18:09.791 [DEBUG] [TestEventLogger] at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
09:18:09.791 [DEBUG] [TestEventLogger] at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
09:18:09.791 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:102)
09:18:09.791 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:82)
09:18:09.791 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:78)
09:18:09.791 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
09:18:09.791 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:18:09.791 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
09:18:09.791 [DEBUG] [TestEventLogger] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:18:09.791 [DEBUG] [TestEventLogger] at java.lang.reflect.Method.invoke(Method.java:498)
09:18:09.791 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
09:18:09.791 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
09:18:09.791 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
09:18:09.791 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
09:18:09.791 [DEBUG] [TestEventLogger] at com.sun.proxy.$Proxy2.stop(Unknown Source)
09:18:09.791 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:132)
09:18:09.791 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:18:09.791 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
09:18:09.791 [DEBUG] [TestEventLogger] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:18:09.791 [DEBUG] [TestEventLogger] at java.lang.reflect.Method.invoke(Method.java:498)
09:18:09.791 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
09:18:09.791 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
09:18:09.791 [DEBUG] [TestEventLogger] at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
09:18:09.791 [DEBUG] [TestEventLogger] at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
09:18:09.791 [DEBUG] [TestEventLogger] at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:412)
09:18:09.791 [DEBUG] [TestEventLogger] at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
09:18:09.791 [DEBUG] [TestEventLogger] at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
09:18:09.791 [DEBUG] [TestEventLogger] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
09:18:09.792 [DEBUG] [TestEventLogger] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
09:18:09.792 [DEBUG] [TestEventLogger] at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
09:18:09.792 [DEBUG] [TestEventLogger] at java.lang.Thread.run(Thread.java:748)
@BenStuart You can specify providerType = ProviderType.ASYNCH
on the @PactTestFor
annotation and that will resolve your issue.
@s1apped that is not related. The test runner checks that all methods annotated with @Pact
where executed during the test.
@uglyog do you want me to open separate issues with more details?
Yes, that is not related to this issue
Yes that resolved my issue thank you. If it's not in the documentation. Perhaps it's a good idea to add it.
providerType = ProviderType.ASYNCH
https://github.com/pact-foundation/pact-jvm/issues/1047#issuecomment-601989810
That worked for me!
Hi,
I am trying to use the MessagePact and am getting
Method pact does not conform required method signature 'public RequestResponsePact xxx(PactDslWithProvider builder)'
when running./gradlew test
Here is my gradle.build deps for pact:
here is my code:
The standard HTTP implementation seems to work ok.
Full log: