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
// ...
}