Category: JUNIT

JUNIT5: What Exactly is org.mockito.junit.jupiter.MockitoExtension and Sling Model Example

org.mockito.junit.jupiter.MockitoExtension is a JUnit 5 extension provided by the Mockito library. It allows you to use the Mockito framework to create and inject mocked objects into your JUnit 5 test classes. This extension provides several features such as annotation-based mock creation, automatic detection of unused stubs, and support for the Mockito API. It enables you […]

AEM JUNIT5 with io.wcm.testing.mock.aem.junit5.AemContextExtension

io.wcm.testing.mock.aem.junit5.AemContextExtension is an extension for JUnit 5 that provides a way to run AEM (Adobe Experience Manager) unit tests with mocked AEM objects. This extension allows you to set up an AemContext object in your JUnit 5 test class, which provides access to mocked AEM objects such as the ResourceResolver, SlingSettings, and more. This makes […]

JUnit 4: AEM Sling Servlet Unit Test Example Using AEM Mocks, Servlet by Resource Type

This article will demonstrate how to write AEM Unit tests for @SlingServletResourceTypes (OSGi DS 1.4 (R7) component property type annotations) using the Junit4 testing framework. With developers being more visual, the source code is posted below. Technologies here used are: AEM project archetype 19 (link) Mockito 2.27.0 (link) AEM Mocks JUnit 4 2.7.2 (link) This […]

Back To Top