Is it possible to mock Workflow.getInfo() method call when writing test case?

I’m writing unit test case for a child workflow.
In the childworkflow, we fetch the parent workflow id by calling Workflow.getInfo().getParentWorkflowId().

As its a unit test, I would be directly running the chlidWorkflow and there won’t be any ParentWorkflow.
Because of this Workflow.getInfo().getParentWorkflowId() will return null.

I want to mock Workflow.getInfo() saw that I can return a custom WorkflowInfo object with parent workflow id.

Is this possible?

I tried with Mockito, looks like it doens’t have any impact.

Or is it possible to set Parent workflow ID manually before starting a child workflow ?

I would recommend creating a parent workflow just for this unit test.