Hi,
To use the import statement import static com.adobe.cq.wcm.core.components.testing.mock.ContextPlugins.CORE_COMPONENTS; successfully, follow these steps:
- Add AEM Mocks Dependency: Include the AEM Mocks library as a test dependency in your project's pom.xml file:
<dependency>
<groupId>io.wcm.testing</groupId>
<artifactId>aem-mock</artifactId>
<version>1.11.0</version>
<scope>test</scope>
</dependency>
- Configure AEM Mocks Context: Set up the AEM Mocks context in your test class using the AemContext rule:
import io.wcm.testing.mock.aem.junit.AemContext;
public class MyTest {
@Rule
public final AemContext context = new AemContext();
// Your test methods here
}