I have a function, that has the following definition:
def expectMsgPF[T](max: Duration = Duration.Undefined, hint: String = "")(f: PartialFunction[Any, T]): T = { When I call it as follows:
val res1 = listener1.expectMsgPF(1.second) Is res1 a function?
I would like to write as follow:
val res1 = listener1.expectMsgPF(1.second) _ val res2 = listener2.expectMsgPF(1.second) Then("it should contain `Kafka and SAP are offline`") res1 { case status: ServerStatus => status.health should be(ServersOffline) } But it does not work.
expectMsgPFis a method, not a function. -res1can be a function, if the expected type is of a function.