Skip to content

Commit 65161c3

Browse files
revert to a working state
1 parent 14309df commit 65161c3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/test/java/io/pactflow/example/kafka/ProductsPactTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ MessagePact createPact(MessagePactBuilder builder) {
3434
PactDslJsonBody body = new PactDslJsonBody();
3535
body.stringType("name", "product name");
3636
body.stringType("type", "product series");
37-
body.stringType("id", "v2"); // testing
37+
body.stringType("id", "5cc989d0-d800-434c-b4bb-b1268499e850");
38+
// body.stringType("id", "v2"); // testing failing scenario
3839
body.stringMatcher("version", "v[a-zA-z0-9]+", "v1");
39-
body.stringMatcher("id", "v[a-zA-z0-9]+", "v1"); // testing
40+
// body.stringMatcher("id", "v[a-zA-z0-9]+", "v1"); // testing failing scenario
4041
body.stringMatcher("event", "^(CREATED|UPDATED|DELETED)$", "CREATED");
4142

4243
Map<String, Object> metadata = new HashMap<>();
@@ -51,8 +52,10 @@ MessagePact createPact(MessagePactBuilder builder) {
5152
void test(List<Message> messages) throws Exception {
5253
ObjectMapper mapper = new ObjectMapper();
5354
System.out.println("Message received -> " + messages.get(0).contentsAsString());
55+
System.out.println(messages.get(0).getMetadata().get("kafka_topic"));
5456
Product product = mapper.readValue(messages.get(0).contentsAsString(), Product.class);
5557

58+
5659
assertDoesNotThrow(() -> {
5760
listener.listen(product);
5861
});

0 commit comments

Comments
 (0)