Closed uglyog closed 9 years ago
Would it be possible to have that in test failure output instead of debug log output? Something like:
*** FAILED ***
ResponseMismatch did not equal FullResponseMatch:
Status 400 is not equal 200.
Body XYZ is not equal ZYX.
(PactSpec.scala:32)
org.scalatest.exceptions.TestFailedException:
at org.scalatest.Assertions$class.newAssertionFailedException(Assertions.scala:500)
at org.scalatest.FreeSpec.newAssertionFailedException(FreeSpec.scala:1740)
at org.scalatest.Assertions$AssertionsHelper.macroAssert(Assertions.scala:466)
at au.com.dius.pact.provider.PactSpec$$anonfun$2$$anonfun$apply$1.apply$mcV$sp(PactSpec.scala:32)
at au.com.dius.pact.provider.PactSpec$$anonfun$2$$anonfun$apply$1.apply(PactSpec.scala:18)
instead of
*** FAILED ***
ResponseMismatch did not equal FullResponseMatch (PactSpec.scala:32)
org.scalatest.exceptions.TestFailedException:
at org.scalatest.Assertions$class.newAssertionFailedException(Assertions.scala:500)
at org.scalatest.FreeSpec.newAssertionFailedException(FreeSpec.scala:1740)
at org.scalatest.Assertions$AssertionsHelper.macroAssert(Assertions.scala:466)
at au.com.dius.pact.provider.PactSpec$$anonfun$2$$anonfun$apply$1.apply$mcV$sp(PactSpec.scala:32)
at au.com.dius.pact.provider.PactSpec$$anonfun$2$$anonfun$apply$1.apply(PactSpec.scala:18)
Reason for that is that we're messing around (like asserting that things are getting logged our way for different log levels, etc.) with log outputs in our acceptance testing, so, it could interfere just debug output.
The debug log was for the gradle and maven plugins. If you're using PactSpec we should be able to change the failure message.
@algra the failure message with PactSpec now looks like:
provider Animal_Service interaction "a request for alligators" in state: "an error has occurred" * FAILED * There were response mismatches: StatusMismatch(500,400) BodyTypeMismatch(application/json,text/plain)
Great, thanks for changing that!
This makes it difficult to diagnose the cause of matching failures.