Let's say I have a provider which is involved in 2 interactions (with one consumer or many, it shouldn't matter).
On the provider side, I am able to handle one interaction in the sense that I know how to interpret the provider state of one interaction but not the other one.
Is there a way to ignore unknown provider states and avoid to fail the verification (or at least avoid to fail the test, I think it would actually make sense to fail the verification)?
I'm using pact4s in Scala with scalatest but I guess a solution for pact-jvm and Junit would still help and could be applied in a similar manner with pact4s.
Here's the Scala code I'm using:
val provider: ProviderInfoBuilder = ProviderInfoBuilder(
"scalatest-provider",
...
)
...
.withStateChangeFunction((state: ProviderState) =>
state match {
case ProviderState("some state", params) =>
// Do something as I know how to handle this provider state
case _ =>
// Unknown provider state, make the test ignore this interaction and not fail
}
)