I do have the PactRunner. Following is the complete test class. Also, I am a little confused with regards to provider states. The consumer side createFragment() builder has the given() method; I am thinking that is to the set the provider state ?? There are also ways where we can setup provider states on the provide JUnit tests I believe, but I would prefer setting up the provider state on the consumer end of things so that my state and the contract tests are in one place. But, I am not sure if that is the issue here at all. Anyway, the test class is here:
@RunWith(PactRunner.class)
@Provider("test_provider")
@PactFolder("/Users/nnalabot/Git/uvvu-publisher/pacts")
public class ContractTest {
@ClassRule
public static final DropwizardAppRule<EventPublisherConfiguration> DW_RULE =
new DropwizardAppRule<>(MockEventPublisherApplication.class, resourceFilePath("event-publisher.yml"),
ConfigOverrideFile.config(resourceFilePath("test/event-publisher.properties"),
ConfigOverride.config("server.applicationConnectors[0].port", AppRuleHelpers.getEnvAppPort()),
ConfigOverride.config("server.adminConnectors[0].port", AppRuleHelpers.getEnvAdminPort())));
@Before
public void setUp() throws Exception {
traceId = TracingHeaders.generateTraceId();
}
@State("default")
public void toDefaultState() {
}
@TestTarget
public final Target target = new HttpTarget(8332);