I want to use camunda-bpm-assert-scenario in my ScalaTests.
There I have this code with receiveTask::receive
:
when(documentRequest.waitsAtReceiveTask("ReceiveTaskWaitForDocuments")).thenReturn((receiveTask) -> {
receiveTask.defer("P1DT1M", receiveTask::receive);
});
According to answer in Is it possible to use a Java 8 style method references in Scala? I can translate this quite easily to:
receiveTask.defer("P1D", receiveTask.receive _)
But this gives me:
Error:(84, 45) type mismatch;
found : Unit
required: org.camunda.bpm.scenario.defer.Deferred
receiveTask.defer("P1D", receiveTask.receive _)
This is the receive
function:
void receive();
And here is the expected interface:
public interface Deferred {
void execute() throws Exception;
}
How can I achieve this in Scala? This is not a duplicate of Is it possible to use a Java 8 style method references in Scala?, there is no solution to "Error:(84, 45) type mismatch; ..."