How to Mock WorkflowService

aemg12

22-09-2020

Below is my original class 

@reference
private ResourceResolverFactory resourceResolverFactory;

@reference
private WorkflowService workflowService;

 

How can I mock the above?

I tried something like below:

 

@Mock
WorkflowService workflowServiceMock;

 

then

workflowServiceMock = context.registerInjectActivateService(workflowServiceMock);

 

But it throws NullPointerException

Accepted Solutions (0)

Answers (1)

Answers (1)

Suraj_Kamdi

MVP

23-09-2020

@aemg12 

Can you please paste some more snippets or logic ? So that it will be more clear to investigate why the workflow session is returning NULLPOINTER_EXCEPTION