One last issue I am facing at the end of the servlet doget method I am closing all of the resoure resolver sessions like beow try{ json.addProperty("success", true); json.addProperty("destination_path", path); response.setSt...
This is my servlet that is invoking a workflow and it is using a workflow model.I am unable to create a stub for the workflow model in the testcase for the servlet.I am using a mock workflow model but it is returning null or throwing exception.The servlet code that starts workflow provided below. Wo...
Hi @Jörg_Hoh, There is a solution provided here for this issue here : [SLING-7195] Sling Mock Oak not working with AEM uber-jar 6.3.0 - ASF JIRA (apache.org)They have provided a sample zip package file which I could download and verify.But this sample package uses uses JUNIT 4 and not JUNIT 5.Belo...
Hi @Jörg_Hoh,I modified the context as private final AemContext aemContext = new AemContext(ResourceResolverType.JCR_OAK);I am getting this below exception:java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver factory: Unable to instantiate resourcer resolver: org.apache.sling....
Everything works when code written in this test class.Problem is occcurs when session.getAccessControlmanager() is executed in the doGet() method in the servlet for which I am writing this test case. This is the code complete test case class for the servlet.( everything works in the testcase, but...
I modified the code as per belowat class level I have add a class level mock like below@MockSession session; Then in the test case wrapped this session using the SessionWrapper provided in URL mentioned earlier. below code works SessionWrapper wrapper = new SessionWrapper(session)assertSame("getAcc...
I am reposting this question as my previous question was closed by mistake as resolved.This test case throws unsupported exception when using the JUNIT5 version as per belowI am instantiating the aem context at class level with below code@ExtendWith({ AemContextExtension.class, MockitoExtension.clas...
Hi @Vijayalaksmi_S,I have marked the correct answer by mistake.I have tried the method you have informed unfortunately it does not work.I need to know if anyone got this issue and ableto resolve this issue.The provided answer may work on JUNIT4 but not when using JUNIT5.I request some one to reopen ...
This test case throws unsupported exception when using the JUNIT5 version as per belowI am instantiating the aem context at class level with below code@ExtendWith({ AemContextExtension.class, MockitoExtension.class })class TrashcanServletTest { private final AemContext aemContext = new AemContext(Re...