Hi ,
I am trying to write a junit for a path based servlet using junit5. The servlet basically reads an input stream (XML format) and then processes that further.
I am trying to load XML from class path src/test/resources :
private final AemContext context = new AemContext();
@BeforeEach
public void setUp() throws Exception {
context.load().fileVaultXml("relative path to XML", "/content/dam/UticaQuoteProposal/samplexml");
}
Exception :
java.lang.IllegalStateException: Unable to enable secure processing.
Cause :
In the parent POM I am using dependency:
<dependency>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.testing.aem-mock.junit5</artifactId>
<version>4.1.0</version>
<scope>test</scope>
</dependency>
In the core bundle pom added :
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.12.2</version>
<scope>test</scope>
</dependency>
Kindly, let me know what might be the root cause for this issue.
Thanks