You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@TestTemplate
@ExtendWith(PactVerificationInvocationContextProvider.class)
void pactVerificationTestTemplate(final Pact<?> pact, final Interaction interaction, final HttpRequest request,
final PactVerificationContext context) throws URISyntaxException {
LOGGER.info("testTemplate called: " + pact.getProvider().getName() + ", " + interaction);
request.addHeader("X-ContractTest", "true");
URIBuilder newBuilder = new URIBuilder(request.getRequestLine().getUri());
List<NameValuePair> params = newBuilder.getQueryParams();
Map<String, String> mappedParams = params.stream()
.collect(Collectors.toMap(NameValuePair::getName, NameValuePair::getValue));
assertThat("crn must be provided as query parameter", mappedParams.keySet(), hasItem("crn"));
context.verifyInteraction();
}
I specified url within PactBroker annotation @PactBroker(url = "https://pact-broker.apps.mdmdev-ocp-saas-cr1.cp.fyre.ibm.com") or @PactBroker(host = "pact-broker.apps.mdmdev-ocp-saas-cr1.cp.fyre.ibm.com", scheme="https"), but the endpoint to fetch contracts becomes http:
[main] DEBUG au.com.dius.pact.provider.junit5.PactVerificationInvocationContextProvider - provideTestTemplateInvocationContexts called
[main] DEBUG au.com.dius.pact.provider.junit5.PactVerificationInvocationContextProvider - Verifying pacts for provider 'mdm-job-v1' and consumer 'null'
[main] DEBUG au.com.dius.pact.provider.junit5.PactVerificationInvocationContextProvider - Pact sources on test class:
@au.com.dius.pact.provider.junitsupport.loader.PactSource(au.com.dius.pact.provider.junitsupport.loader.PactBrokerLoader.class)
[main] DEBUG au.com.dius.pact.provider.ProviderUtils - Pact source does not have a constructor with one argument of type Class
[main] DEBUG au.com.dius.pact.provider.junitsupport.loader.PactBrokerLoader - Loading pacts from pact broker for provider mdm-job-v1 and consumer version selectors []
[main] DEBUG au.com.dius.pact.provider.junitsupport.loader.PactBrokerLoader - Authentication: None
[main] DEBUG au.com.dius.pact.core.pactbroker.HalClient - Fetching: /
[main] DEBUG au.com.dius.pact.core.pactbroker.PactBrokerClient - Fetching pacts using the pactsForVerification endpoint
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 17.399 s <<< FAILURE! - in com.ibm.entity.analytics.job.pact.ContractVerificationTest
[ERROR] com.ibm.entity.analytics.job.pact.ContractVerificationTest.pactVerificationTestTemplate(Pact,Interaction,HttpRequest,PactVerificationContext) Time elapsed: 17.397 s <<< ERROR!
au.com.dius.pact.core.pactbroker.RequestFailedException: Request to path 'http://pact-broker.apps.mdmdev-ocp-saas-cr1.cp.fyre.ibm.com/pacts/provider/mdm-job-v1/for-verification' failed with response 'HTTP/1.0 503 Service Unavailable'
at au.com.dius.pact.core.pactbroker.HalClient.handleHalResponse(HalClient.kt:304)
at au.com.dius.pact.core.pactbroker.HalClient.access$handleHalResponse(HalClient.kt:140)
at au.com.dius.pact.core.pactbroker.HalClient$postJson$3.invoke(HalClient.kt:476)
at au.com.dius.pact.core.pactbroker.HalClient$postJson$3.invoke(HalClient.kt:140)
at au.com.dius.pact.core.support.KotlinLanguageSupportKt.handleWith(KotlinLanguageSupport.kt:38)
at au.com.dius.pact.core.pactbroker.HalClient.postJson(HalClient.kt:474)
at au.com.dius.pact.core.pactbroker.PactBrokerClient$fetchPactsUsingNewEndpoint$2.invoke(PactBrokerClient.kt:291)
at au.com.dius.pact.core.pactbroker.PactBrokerClient$fetchPactsUsingNewEndpoint$2.invoke(PactBrokerClient.kt:173)
at au.com.dius.pact.core.support.KotlinLanguageSupportKt.handleWith(KotlinLanguageSupport.kt:38)
at au.com.dius.pact.core.pactbroker.PactBrokerClient.fetchPactsUsingNewEndpoint(PactBrokerClient.kt:290)
at au.com.dius.pact.core.pactbroker.PactBrokerClient.fetchConsumersWithSelectors(PactBrokerClient.kt:249)
at au.com.dius.pact.provider.junitsupport.loader.PactBrokerLoader.loadPactsForProvider(PactBrokerLoader.kt:219)
at au.com.dius.pact.provider.junitsupport.loader.PactBrokerLoader.load(PactBrokerLoader.kt:117)
at au.com.dius.pact.provider.junit5.PactVerificationInvocationContextProvider$resolvePactSources$$inlined$flatMap$lambda$1.invoke(PactJUnit5VerificationProvider.kt:80)
at au.com.dius.pact.provider.junit5.PactVerificationInvocationContextProvider$resolvePactSources$$inlined$flatMap$lambda$1.invoke(PactJUnit5VerificationProvider.kt:37)
at au.com.dius.pact.core.support.KotlinLanguageSupportKt.handleWith(KotlinLanguageSupport.kt:38)
at au.com.dius.pact.provider.junit5.PactVerificationInvocationContextProvider.resolvePactSources(PactJUnit5VerificationProvider.kt:80)
at au.com.dius.pact.provider.junit5.PactVerificationInvocationContextProvider.provideTestTemplateInvocationContexts(PactJUnit5VerificationProvider.kt:41)
Also tried passing-Dpactbroker.url=https://pact-broker.apps.mdmdev-ocp-saas-cr1.cp.fyre.ibm.com or -Dpactbroker.host=pact-broker.apps.mdmdev-ocp-saas-cr1.cp.fyre.ibm.com -Dpactbroker.scheme=https as maven properties, same result. Could @uglyog please help?
The text was updated successfully, but these errors were encountered:
Hello, I am using version 4.1.21 to verify contracts. maven dependency:
java code snippet:
I specified url within PactBroker annotation
@PactBroker(url = "https://pact-broker.apps.mdmdev-ocp-saas-cr1.cp.fyre.ibm.com")
or@PactBroker(host = "pact-broker.apps.mdmdev-ocp-saas-cr1.cp.fyre.ibm.com", scheme="https")
, but the endpoint to fetch contracts becomes http:Also tried passing
-Dpactbroker.url=https://pact-broker.apps.mdmdev-ocp-saas-cr1.cp.fyre.ibm.com
or-Dpactbroker.host=pact-broker.apps.mdmdev-ocp-saas-cr1.cp.fyre.ibm.com -Dpactbroker.scheme=https
as maven properties, same result. Could @uglyog please help?The text was updated successfully, but these errors were encountered: