0

All, How to enable debugging to figure out why I am getting this initialization Error Pact version: 4.0.10 Is there a way to enable debug (this is spring boot app)

org.junit.runners.model.InitializationError
    at au.com.dius.pact.provider.junit.PactRunner.initialize(PactRunner.kt:112)
    at au.com.dius.pact.provider.junit.PactRunner.getChildren(PactRunner.kt:140)
    at org.junit.runners.ParentRunner.getFilteredChildren(ParentRunner.java:426)
    at org.junit.runners.ParentRunner.getDescription(ParentRunner.java:351)
    at com.intellij.junit4.JUnit4IdeaTestRunner.getDescription(JUnit4IdeaTestRunner.java:78)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:50)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:66)
  • How are you running it? Gradle? Maven? They usually have a debug flag you can pass, so i'd start there. e.g. ./gradlew clean test -l debug – Matthew Fellows May 28 '21 at 07:24
  • Thanks. maven is not finding the test (not attempting to run). Using IDE, I changed my provider/state to an already existing entry and that atleast ran. So i suspect something wrong with the entry in pactbroker. I want to test using PactFolder to run the test. In SpringBoot App, what would be the path of this folder. I am using @PactFolder("pacts") . I tried putting the pact json file in target/pacts, src/test/resources , but still get the same initialization error. My Pact Spec is: 3.0.0 The provider and consumer name looks right. – technimadhu Jun 01 '21 at 15:32
  • Might be best jumping into slack.pact.io and asking there in the #pact-jvm channel – Matthew Fellows Jun 03 '21 at 01:39
  • I'm having the same exception for provider side. Consumer side can upload the contract using the same broker settings on the same PC without problems. How can I see the exception details? – Cagin Uludamar Feb 20 '23 at 08:22

1 Answers1

0

All, I found my problem. User error. but I wish there was an error or warning log. I used @PactFilter and the state value I used in that was wrong. but my actual test had the right state value in some. So the filter was not finding any test and would throw this initialization error. I did not realize the PactFilter was optional. I commented it out, and then I got a proper error message indicating state not found in the pact broker.