Hi,
While trying to test Temporal workflow(using java temporal-sdk - version 1.28.3) using Spock and Groovy, we are facing the below exception.
java.lang.Error: Called from non workflow or workflow callback thread
at io.temporal.internal.sync.DeterministicRunnerImpl.currentThreadInternal(DeterministicRunnerImpl.java:130)
at io.temporal.internal.sync.CompletablePromiseImpl.<init>(CompletablePromiseImpl.java:65)
at io.temporal.internal.sync.WorkflowInternal.newCompletablePromise(WorkflowInternal.java:128)
at io.temporal.workflow.Workflow.newPromise(Workflow.java:533)
at io.temporal.internal.sync.AsyncInternal.execute(AsyncInternal.java:299)
at io.temporal.internal.sync.AsyncInternal.function(AsyncInternal.java:56)
at io.temporal.workflow.Async.function(Async.java:38)
How to resolve this?