Mocking Workflow.getVersion in Junit

Is there any example to mock Workflow.getVersion in Junit?
The current test cases are working as expected but after adding the version, I start getting below exception

java.lang.Error: Called from non workflow or workflow callback thread
	at io.temporal.internal.sync.DeterministicRunnerImpl.currentThreadInternal(
	at io.temporal.internal.sync.WorkflowInternal.getWorkflowInterceptor(
	at io.temporal.internal.sync.WorkflowInternal.getVersion(
	at io.temporal.workflow.Workflow.getVersion(

I am checking the version inside the activity.


Can’t call Workflow.gerVersion from activity, only in workflow code. Can you give more info on what you are trying to test?