Unable to mock Node on Java 17 AEM 6.5 LTS
Hello AEM Community,
We've recently migrated our environment from AEM 6.5 to AEM 6.5 LTS. Post-migration, we've observed that several of our previously passing test cases are now failing. These failures are impacting our deployment pipeline, and we're seeking insights to resolve them.
Details:
Migration Overview: Transitioned from AEM 6.5 to AEM 6.5 LTS following Adobe's recommended procedures.
Test Framework: Utilizing JUnit 5 for unit testing.
Issue Observed: Test cases that involve component initialization and resource adaptation are failing. Specifically, tests that previously passed are now encountering NullPointerException during the execution of the init() method in our models.
public final AemContext context = new AemContext(JCR_MOCK);
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.sling-mock.junit5</artifactId>
<version>3.5.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.testing.aem-mock.junit5</artifactId>
<version>5.6.10</version>
<exclusions>
<exclusion>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.scripting.api</artifactId>
</exclusion>
</exclusions>
</dependency>