From 25ba8d936c5f01c9df1d5c6d497aeddfe69fe791 Mon Sep 17 00:00:00 2001 From: anto Date: Thu, 11 Jun 2020 09:47:57 +0100 Subject: [PATCH] feat: #1112 add interaction description and consumer name to output when an expected state change cannot be found --- .../au/com/dius/pact/provider/junit/InteractionRunner.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/provider/junit/src/main/kotlin/au/com/dius/pact/provider/junit/InteractionRunner.kt b/provider/junit/src/main/kotlin/au/com/dius/pact/provider/junit/InteractionRunner.kt index a501dc50a7..3ee205c055 100644 --- a/provider/junit/src/main/kotlin/au/com/dius/pact/provider/junit/InteractionRunner.kt +++ b/provider/junit/src/main/kotlin/au/com/dius/pact/provider/junit/InteractionRunner.kt @@ -261,7 +261,9 @@ open class InteractionRunner( val methods = findStateChangeMethod(state, testTarget.getStateHandlers()) if (methods.isEmpty()) { return Fail(MissingStateChangeMethod("MissingStateChangeMethod: Did not find a test class method annotated " + - "with @State(\"${state.name}\")")) + "with @State(\"${state.name}\") " + + "for Interaction (\"${interaction.description}\") " + + "and Consumer ${pact.consumer.name}")) } else { stateChange = RunStateChanges(stateChange, methods, listOf(Supplier { target }) + testTarget.getStateHandlers().map { it.right }, state, testContext, testTarget.verifier)