Skip to content

Commit

Permalink
Merge pull request #1122 from anto-ac/improve-output-when-missing-sta…
Browse files Browse the repository at this point in the history
…te-change

feat: #1112 junit5: print interaction and consumer name for missing s…
  • Loading branch information
Ronald Holshausen authored Jun 14, 2020
2 parents e98b2c7 + 0f2921c commit c0a459c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ class PactVerificationStateChangeExtension(
val stateChangeMethods = findStateChangeMethods(context.requiredTestInstance,
testContext.stateChangeHandlers, state)
if (stateChangeMethods.isEmpty()) {
errors.add("Did not find a test class method annotated with @State(\"${state.name}\")")
errors.add("Did not find a test class method annotated with @State(\"${state.name}\") \n" +
"for Interaction \"${testContext.interaction.description}\" \n" +
"with Consumer \"${testContext.consumer.name}\"")
} else {
stateChangeMethods.filter { it.second.action == action }.forEach { (method, _, instance) ->
logger.debug { "Invoking state change method ${method.name} for state '${state.name}' on $instance" }
Expand Down

0 comments on commit c0a459c

Please sign in to comment.