Ankit Rawat
03/11/2022, 6:34 PMMike
03/15/2022, 12:12 PM@PactDirectory("pact-files")
@Provider("iPaaS_Stripe")
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class PactStripeProviderTest {
as a result
Did not find any PactSource annotations. At least one pact source must be set
java.lang.UnsupportedOperationException: Did not find any PactSource annotations. At least one pact source must be set
However, pact is present in pact-files folder. Do you know how to handle this?Jayachandra K
03/17/2022, 6:32 AMpact {
publish {
pactDirectory = "$buildDir/pacts"
pactBrokerUrl = '<https://pact.sample.com/>'
pactBrokerUsername = 'username'
pactBrokerPassword = System.getenv("PACT_PASSWORD")
version = System.getenv("COMMIT_HASH")
}
}
with this config the project version is affected and changed to the version of pact
I want to keep actual project version 1.0-SNAPSHOT
and pact consumer version to COMMIT_HASH
,. Is it possible or am i missing something here?
pact-broker version 2.94.0.0
PIERRE GERARD
03/17/2022, 3:23 PMSaurabh Goel
03/24/2022, 10:16 AMUnable to fetch provider method ...
uglyog
Serghei Pogodin
03/30/2022, 8:16 AMmatchQuery("myQueryParam", ".*")
it's generating a value which is not supported by Pactflow. Example of generated value: "\u095D"
.
Do you think this should be fixed in Pact JVM or Pactflow should be able to handle values like this?André Sousa
03/30/2022, 4:45 PMBen Eyres
03/30/2022, 5:44 PM.withFileUpload("file",
"some.json",
"multipart/form-data",
new byte[]{10,40,61,153,16})
but what im struggling with is how to add non-file key:values pairs? a curl example would be:
curl --location --request POST '<http://localhost:8888/v1/some/ep>' \
--form 'data1="abc"' \
--form 'data2="def' \ \
--form 'fileData=@"/some/file_dir/some_file.gz"'
Can anyone explain how i add data1
and data2
to my pact? Thanks a lot!Justin Berger
03/30/2022, 9:23 PMval pact = ConsumerPactBuilder
.consumer("Android")
.pactSpecVersion(PactSpecVersion.V2)
...
.willRespondWith()
.status(200)
.body(
newJsonObject {
this.`object`("data") { o ->
o.integerType("created_at", 1648049202)
}
}
)
I was hoping that setting it to pact spec 2 it would generate (yeah, it's still not quite v2, but go supports the v3 doc, just not the v3 matchers)
"$.data.tokens[0].created_at": {
"combine": "AND",
"matchers": [
{
"match": "type"
}
]
},
but instead it's still generating te v3 matcher (which isn't yet supported in go, which is what our producer is written in)
"$.data.tokens[0].created_at": {
"combine": "AND",
"matchers": [
{
"match": "integer"
}
]
},
Michael Branders
04/01/2022, 1:12 PMAyush
04/04/2022, 7:58 AMshiva kumar velde
04/04/2022, 11:32 AMAndré Sousa
04/04/2022, 4:02 PMJason Army
04/04/2022, 9:05 PMclasspath 'au.com.dius.pact.provider:gradle:4.2.11'
in one of the build files and getting this error:
13:33:09 A problem occurred evaluating project ':dsp-service'.
13:33:09 > java.lang.UnsupportedClassVersionError: au/com/dius/pact/provider/gradle/PactPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Is there a specific version of the gradle plugin that supports JDK 8?Prabhakar
04/06/2022, 12:35 AMDslPart requestBody = LambdaDsl.newJsonBody((o) -> {
o.array("idList", (arr)-> {
arr.numberType(6);
});
This would work if I am passing only one value. If more than value need to be in the list then I have to add something like this...
arr.numberType(6).numberType(7);
How can this be made generalized (like minArrayLike) so that one or more could be passed and contract is still validBen Eyres
04/06/2022, 6:08 AMmvn pact:publish -Dpact.publish.consumer.version=0.2-SNAPSHOT
export PACT_PUBLISH_CONSUMER_VERSION=0.2-SNAPSHOT
Neither seem to work. Im getting the following error from the plugin when running mvn pact:publish
Cannot change the content of the pact for Producer version 0.1-SNAPSHOT and provider Producer, as race conditions will cause unreliable results for can-i-deploy. Each pact must be published with a unique consumer version number
Can anyone tell me how i can increment the consumer version of the pact?Gokul Menon
04/06/2022, 9:49 AMDeepesh Gupta
04/07/2022, 1:34 PMMichael Branders
04/08/2022, 8:40 AM@Getter
@ToString
@Builder(toBuilder = true)
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
public class ObjectDto {
private final String id;
private final Map<Locale, String> descriptions;
}
I need to get that map in DSL
private DslPart objectDtoContract() {
return newJsonBody((o)->{
o.stringMatcher("id", REGEX_ID, OBJECT_ID);
o.array("description",(map)->{
????
});
}).build();
}
Dont realy find any examples on how to get a map in a DslPartCarl Ha
04/11/2022, 10:53 AMSongqing
04/12/2022, 12:30 AMAlessandro
04/12/2022, 2:03 PMNathan Deamer
04/12/2022, 5:21 PMpact.verifier.buildUrl
- Should I be able to see this in pactflow anywhere?
I am using id '<http://au.com|au.com>.dius.pact' version '4.3.5'
gradle plugin.
https://github.com/pact-foundation/pact-jvm/blob/master/provider/junit/README.md#setting-the-build-url-for-verification-results-4216432James P
04/13/2022, 4:44 PMquery
parameter url encode the variables it is sent? I have a service which sends a uri encoded value to another service "from=2022-04-11T09%3A52%3A59%2B0100"
as a query parameter in the path. If I try and do a comparison using this value then it fails with an unexpected request error. However, if I wrap the query parameter in a uri decode statement then the request matches. When I send the http request, I just enter the value specified and thats enough to match.
UPDATE: I've just found the encodedQuery
param which has sorted out me having to encode the query, however the json I have generated does not have the encoded versionPavlo Sprogis
04/14/2022, 1:55 PMERROR [15:45:47] [main] a.c.d.p.c.p.HalClient Failed to fetch the root HAL document
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
...
is there a way to fix this (on my laptop and during CI build) ?Francislainy Campos
04/18/2022, 6:42 AMAurelia
04/20/2022, 1:53 PMyusei ygui
04/20/2022, 8:45 PMDennis Woditsch
04/21/2022, 12:23 PMrequired
verification. To come to the question: We saw that PACT verified several versions - especially from PR's which actually might not exist anymore at this time. I think it would make most sense to just verify against deployed versions of a service right? Basically latest master/main would be fine + all versions deployed on environments (recorded deployments). Is there some configuration available? Here is my current (provider) test setup
@Provider("goto-conference-service")
@PactBroker
@SpringBootTest
@Import(KafkaConsumerConfiguration.class)
@AutoConfigureMockMvc
@AllowOverridePactUrl
public class ConferenceEventsContractTests extends TestcontainersIntegrationTests {
@Autowired
private MockMvc mockMvc;
@Autowired
private ObjectMapper objectMapper;
@TestTemplate
@ExtendWith(PactVerificationInvocationContextProvider.class)
void testTemplate(Pact pact, Interaction interaction, PactVerificationContext context) {
context.verifyInteraction();
}
@BeforeAll
static void beforeAll(){
PactBrokerDefaults.initFallbackTokenIfMissing();
PactBrokerDefaults.initFallbackUrlIfMissing();
}
@BeforeEach
void before(PactVerificationContext context) {
context.setTarget(new MessageTestTarget());
}
@PactVerifyProvider("valid conference created event")
public String verifyConferenceCreatedEvent() throws Exception {
ConferenceEvent createdEvent = getEventByCreateTrigger(event -> "ConferenceCreated".equals(event.getEventName()));
return objectMapper.writeValueAsString(createdEvent);
}
// some more not relevant pieces of code
}