SlingModel JUnit test exception error | Community
Skip to main content
New Participant
December 18, 2017
Solved

SlingModel JUnit test exception error

  • December 18, 2017
  • 1 reply
  • 2329 views

Hi,

I am trying to write a very basic unit test for my Sling Model. The purpose of my model is very elementary: read some simple structure from repository and build a Map of key/values out of it. I am using JUnit and Sling Mock for unit testing. I am using Resource Resolver mock default implementation to build the test content in memory.

My code is below: I only have one test method.

Code:

Unfortunately I am having the following exception:

Could you please maybe help me to understand where is the mistake?

Thanks!

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 boser87

I was able to fix to issue myself. I moved the unit test dependency on top of the pom xmls and unit tests started to work.

1 reply

boser87AuthorAccepted solution
New Participant
December 18, 2017

I was able to fix to issue myself. I moved the unit test dependency on top of the pom xmls and unit tests started to work.