How to Mock WorkflowService | Community
Skip to main content
New Participant
September 23, 2020
Solved

How to Mock WorkflowService

  • September 23, 2020
  • 2 replies
  • 1028 views

Below is my original class 

@3214626
private ResourceResolverFactory resourceResolverFactory;

@3214626
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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Suraj_Kamdi

@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

2 replies

Anudeep_Garnepudi
New Participant
October 27, 2020

Hi @aemg12 

Based on the code you shared, context seems to be NULL, check that. If not please share code with error stack.

AG

Suraj_Kamdi
Suraj_KamdiAccepted solution
New Participant
September 23, 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