コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

この会話は、活動がないためロックされています。新しい投稿を作成してください。

解決済み

SlingModel JUnit test exception error

Avatar

Level 4

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!

1 受け入れられたソリューション

Avatar

正解者
Level 4

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 返信

Avatar

正解者
Level 4

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.