How to Mock WorkflowService | Adobe Higher Education
Skip to main content
Level 2
September 23, 2020
解決済み

How to Mock WorkflowService

  • September 23, 2020
  • 2 の返信
  • 1029 ビュー

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

このトピックへの返信は締め切られました。
ベストアンサー 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 の返信

Suraj_Kamdi
Community Advisor
Community Advisor
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

Anudeep_Garnepudi
Community Advisor
Community Advisor
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

AG