Skip to content

Commit

Permalink
2.12 partial functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jbwheatley committed Dec 31, 2021
1 parent 667f812 commit 18fe434
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ class RequestResponseVerifierStateChangeFunctionMunitSuite extends CatsEffectSui
providerName = "Pact4sProvider",
fileName = "./scripts/Pact4sConsumer-Pact4sProvider.json"
)
.withStateChangeFunction { case ProviderState("bob exists", params) =>
.withStateChangeFunction({ case ProviderState("bob exists", params) =>
val _ = params.getOrElse("foo", fail("params missing value foo"))
mock.stateRef.set(Some("bob")).unsafeRunSync()
}
}: PartialFunction[ProviderState, Unit])
.withStateChangeFunctionConfigOverrides(_.withOverrides(portOverride = 64643))

override val munitFixtures: Seq[Fixture[_]] = Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class RequestResponseVerifierStateChangeFunctionScalaTestSuite extends AnyFlatSp
providerName = "Pact4sProvider",
fileName = "./scripts/Pact4sConsumer-Pact4sProvider.json"
)
.withStateChangeFunction { case ProviderState("bob exists", params) =>
.withStateChangeFunction({ case ProviderState("bob exists", params) =>
val _ = params.getOrElse("foo", fail())
mock.stateRef.set(Some("bob")).unsafeRunSync()
}
}: PartialFunction[ProviderState, Unit])
.withStateChangeFunctionConfigOverrides(_.withOverrides(portOverride = 64645))

var cleanUp: IO[Unit] = IO.unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ object RequestResponseVerifierStateChangeFunctionWeaverSuite extends IOSuite wit
providerName = "Pact4sProvider",
fileName = "./scripts/Pact4sConsumer-Pact4sProvider.json"
)
.withStateChangeFunction { case ProviderState("bob exists", params) =>
.withStateChangeFunction({ case ProviderState("bob exists", params) =>
val _ = params.getOrElse("foo", fail("params missing value foo"))
mock.stateRef.set(Some("bob")).unsafeRunSync()
}
}: PartialFunction[ProviderState, Unit])
.withStateChangeFunctionConfigOverrides(_.withOverrides(portOverride = 64645))

pureTest("Verify pacts for provider `Pact4sProvider`") {
Expand Down

0 comments on commit 18fe434

Please sign in to comment.