From a7251bda067735f305abdff1ece9a47606ddb3d1 Mon Sep 17 00:00:00 2001 From: Tim Vahlbrock Date: Sun, 14 Jul 2024 16:14:10 +0200 Subject: [PATCH] inject message context (fails) --- .../au/com/dius/pact/consumer/junit5/PactConsumerTestExt.kt | 2 +- .../au/com/dius/pact/consumer/junit5/TestTemplateTest.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/consumer/junit5/src/main/kotlin/au/com/dius/pact/consumer/junit5/PactConsumerTestExt.kt b/consumer/junit5/src/main/kotlin/au/com/dius/pact/consumer/junit5/PactConsumerTestExt.kt index 77c84662e..938980509 100644 --- a/consumer/junit5/src/main/kotlin/au/com/dius/pact/consumer/junit5/PactConsumerTestExt.kt +++ b/consumer/junit5/src/main/kotlin/au/com/dius/pact/consumer/junit5/PactConsumerTestExt.kt @@ -104,7 +104,7 @@ class PactConsumerTestExt : Extension, BeforeTestExecutionCallback, BeforeAllCal .methods .find { AnnotationSupport.isAnnotated(it, TestTemplate::class.java) } - return testTemplate != null && testTemplate.parameters[0].type == V4Interaction.AsynchronousMessage::class.java + return testTemplate != null && testTemplate.parameters[0].type == AsynchronousMessageContext::class.java } override fun provideTestTemplateInvocationContexts(extensionContext: ExtensionContext): Stream { diff --git a/consumer/junit5/src/test/kotlin/au/com/dius/pact/consumer/junit5/TestTemplateTest.kt b/consumer/junit5/src/test/kotlin/au/com/dius/pact/consumer/junit5/TestTemplateTest.kt index 1662653a5..e25a048c8 100644 --- a/consumer/junit5/src/test/kotlin/au/com/dius/pact/consumer/junit5/TestTemplateTest.kt +++ b/consumer/junit5/src/test/kotlin/au/com/dius/pact/consumer/junit5/TestTemplateTest.kt @@ -68,9 +68,9 @@ class TestTemplateTest { } @TestTemplate - fun testPactForReservationBooking(message: V4Interaction.AsynchronousMessage) { - assertThat(message, `is`(notNullValue())) - when (message.description) { + fun testPactForReservationBooking(context: AsynchronousMessageContext) { + assertThat(context.message, `is`(notNullValue())) + when (context.message.description) { "a purchase started message to book a reservation" -> { reservationRan = true }