pact-foundation / pact-jvm

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://docs.pact.io
Apache License 2.0
1.08k stars 479 forks source link

Can't publish provider tag name to Pact Broker in 4.0.1 release #960

Open azerzeynalzada opened 4 years ago

azerzeynalzada commented 4 years ago

I'am using 4.0.1 with java.My code as below.I have specified the provider tag name in JVM system property and also provider version.The provider version is publishing to Pact-Broker,but the tag name not.I think there is issue with tag name.

@ExtendWith(SpringExtension.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @ContextConfiguration(classes = Application.class) @ActiveProfiles("dev") @Provider("adapter-litka") @PactBroker(host = "192.168.1.6", consumers = "ms-litka") @VerificationReports({"console", "json"}) public class PactProviderLiveTest {

@MockBean
private Service service;

@BeforeEach
public void setupTestTarget(PactVerificationContext context) {
    context.setTarget(new HttpTestTarget("localhost", 3412, "/adapter-litka"));

    System.setProperty("pact.provider.tag", "dev");
    System.setProperty("pact.provider.version", "version1");
    System.setProperty("pact.verifier.publishResults", "true");

    System.out.println(System.getProperties());
}

@TestTemplate
@ExtendWith(PactVerificationInvocationContextProvider.class)
public void pactVerificationTestTemplate(PactVerificationContext context) {
    context.verifyInteraction();
}

@State("status endpoint is up")
public void toGetState() {
    String customerId = "00086330";
    Dto dto = new Dto();
    dto.setCustomerId("xxxxx");  when(service.getDtos(eq(customerId))).thenReturn(Collections.singletonList(dto));
}

}

uglyog commented 4 years ago

Related to #823