Mocking a child workflow

Hello, i am trying to mock somehow the behavior of a childworkflow present in my workflow… i tried to do this with Junit5 using 2 different approaches:

FIRST ONE:

@RegisterExtension
public static final TestWorkflowExtension testWorkflowExtension =
TestWorkflowExtension.newBuilder()
.setWorkflowTypes(DefaultParentWorkflow.class)
.setDoNotStart(true)
.build();

@Test
public void test(TestWorkflowEnvironment testEnv, Worker worker, ParentWorkflow workflow){
    worker.addWorkflowImplementationFactory(
        ChildWorkflowSameId.class,
        ()->{
            ChildWorkflowSameId child = mock(ChildWorkflowSameId.class);
            doThrow(RuntimeException.class).when(child).doSomethingChild();
            return child;
        });
    testEnv.start();
    workflow.doSomethingParent();
}

SECOND ONE:

@RegisterExtension
public static final TestWorkflowExtension testWorkflowExtension =
TestWorkflowExtension.newBuilder()
.setWorkflowTypes(DefaultParentWorkflow.class,DefaultChildWorkflowWithSameId.class)
.setDoNotStart(true)
.build();

@Test
public void test(TestWorkflowEnvironment testEnv, Worker worker, ParentWorkflow workflow){
    DefaultActivityForChild defaultActivityForChild = mock(DefaultActivityForChild.class);
    doNothing().when(defaultActivityForChild).doSomethingActivity();
    worker.registerActivitiesImplementations(defaultActivityForChild);
    testEnv.start();
    workflow.doSomethingParent();
}

Both in debug appear to throw the following exception:
Method threw ‘java.lang.IllegalArgumentException’ exception. Cannot evaluate jdk.proxy2.$Proxy73.toString()