JUNIT SAXNotRecognizedException Testing locally and getting error at this this line: ctx.load().json("/com/test/core/models/impl/CardTest.json", "/content");
Java test class:
@ExtendWith({AemContextExtension.class, MockitoExtension.class})
public class CardTest {
private final AemContext ctx = new AemContext();
private Card card;
@BeforeEach
public void setUp() throws Exception {
ctx.addModelsForClasses(Card .class);
ctx.load().json("/com/test/core/models/impl/CardTest.json", "/content");
}
@2785667
void testGetTitle() {
ctx.currentResource("/content/cardtest");
card = ctx.request().adaptTo(Card.class);
assertEquals("Title", card.getTitle());
}
CardTest.json
{
"cardtest": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "test/components/test-component",
"title": "Title"
}
}
java.lang.IllegalStateException: Unable to enable secure processing.
at org.apache.sling.contentparser.xml.jcr.internal.JCRXMLContentParser.(