0
我正在與wcm.io的AemContext單元測試我的AEM類。如何從wmc.io檢索會話AemContext
有什麼辦法從它獲取JCR會話?或者可能是郵件列表,可能會產生答案?
我試圖
import io.wcm.testing.mock.aem.junit.AemContext;
import javax.jcr.Session;
// ...
public class MyTest {
@Rule
public AemContext aemContext = new AemContext();
@Test
public void selfTest() throws Exception {
// something like this is called inside the class I test.
// I need the Session to *not* be null.
Session session = aemContext.resourceResolver().adaptTo(Session.class);
assertNotNull("session is " + session, session);
}
// actual tests follow that do not work due to the problem above
// ...
}