Anna Nava
12/04/2023, 4:51 PM<http://au.com|au.com>.dius.pact.consumer.dsl.DslPart
for protobuf.... so I wonder if Protobuf requires a different approach to what I am attempting here questionmario
@Pact(consumer = "my-service")
fun createPact(builder: PactBuilder): V4Pact {
val messageFile = loadFileFromJarResource("/events/pub/a/v1/a_event.proto")
return builder
.usingPlugin("protobuf")
.expectsToReceive("an AEvent ", "core/interaction/message")
.with(
mapOf(
"message.contents" to mapOf(
"pact:proto" to messageFile.path,
"pact:message-type" to "AlertEvent",
"pact:content-type" to "application/protobuf",
"pact:protobuf-config" to mapOf("additionalIncludes" to listOf("/Users/anna.nava/dev/protobuf/proto")),
"this_amazing_property" to mapOf(
//this compiles, but passes empty string: "id" to regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$")
//this doesn't compile:"id" to matchRegex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$")
//this compiles, but ends up passing in an empty string: "id" to regex("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}")
//"id" to mapOf("matchers" to mapOf("match" to "regex", "regex" to "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}\$" ))
"id" to regexp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$", "123e4567-e89b-12d3-a456-426614174000")
),
(apologies if this is not the right channel for, very appreciated if anyone can redirect me where is best for me to ask this, thanks!)rholshausen
12/05/2023, 12:05 AM"this_amazing_property" to "matching(uuid, '123e4567-e89b-12d3-a456-426614174000')"
Anna Nava
12/05/2023, 12:59 PMmatching(uuid, '123e4567-e89b-12d3-a456-426614174000')
│ ──┬─
│ ╰─── This is not a valid matcher type
│
│ Note: Valid matchers are: equalTo, regex, type, datetime, date, time, include, number, integer, decimal, boolean, contentType, semver
Anna Nava
12/05/2023, 3:31 PM"this_amazing_property" to "matching(regex, '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}\$', '123e4567-e89b-12d3-a456-426614174222')"
Anna Nava
12/06/2023, 9:53 AM