Skip to content

Commit

Permalink
inject message context (fails)
Browse files Browse the repository at this point in the history
  • Loading branch information
timvahlbrock committed Jul 14, 2024
1 parent de83916 commit a7251bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<TestTemplateInvocationContext> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit a7251bd

Please sign in to comment.