我正在使用 wcm.io 的AemContext对我的AEM课程进行单元测试。
有没有办法从中获取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
// ...
}