Expand my Community achievements bar.

SOLVED

Getting Null Pointer Exception while running the Junit test case

Avatar

Level 4

Hi all,

I created the Junits test case for one of my simple return method but while trying to run the junit test case it throws an Null Pointer Exception as below screen shot, please give some suggestion for resolving this error.

 

Screenshot (1026).png

Screenshot (1027).png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
5 Replies

Avatar

Community Advisor

@Nandheswara 

 

Your Sling Model is failing to initialize. Check all injectors in Sling Model are configured in JSON. 

Avatar

Correct answer by
Community Advisor

Avatar

Community Advisor

I am glad to hear, it works for you.
If any piece of information shared by us, solves someone problem purpose solved for us.

Thank you for your feedback.

Umesh Thakur