I wrote a provider test class using PACT, that has two tests. The tests successfully run when I run the entire class, but I can't run one test only by right clicking one @State, as no tests seem to be found. Any ideas as how could I run in IntelliJ one test only? Provider test class:
@consumer("teh_consumer")
@Provider("teh_provider")
@PactBroker
@IgnoreNoPactsToVerify
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
//@SpringBootTest
public class TehAppContractTests {
@TestTarget
public final Target target = new SpringBootHttpTarget();
@State("Teh services are up")
public void testServicesUpRequest() {
}
@State("Teh services are down")
public void testServicesDownRequest() {
}
}
Stack trace:
java.lang.Exception: No tests found matching Method testServicesUpRequest(com.teh.contract.TehAppContractTests) from org.junit.internal.requests.ClassRequest@191e654
at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:40)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:50)
at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)