Spring is the easiest one. Then you have SpEL and it will give you component naming.
Then you can use Mocks.register("expression", instance) if you do anything manually.
A better approach is to use the extension called camunda-bpm-mockito which provides you a helper for mocking… In general it is CamundaMockito.registerJavaDelegateMock("expression").
If you want to give it behavior in your test, you would do CamundaMockito.getJavaDelegateMock("expression").onExecutionSetVariables() or CamundaMockito.getJavaDelegateMock("expression").onExecutionThrowBpmnError()…