Unit testing FrameworkUtil.getBundle(this.getClass()).getBundleContext();在wcm.io中返回null
当我们使用wcm.io框架为aem代码库编写junit时,下面一行的值将为NULLUnit testing FrameworkUtil.getBundle(this.getClass()).getBundleContext();在wcm.io中返回null,unit-testing,Unit Testing,当我们使用wcm.io框架为aem代码库编写junit时,下面一行的值将为NULL BundleContext bctx = FrameworkUtil.getBundle(this.getClass()).getBundleContext(); 欢迎提供任何帮助。您是否使用了任何特定的模拟框架以及模拟设置如何?我们使用wcm.io框架和AemContext builder类来填充对象。请在下面找到和平的代码,它可能有助于完全公开静态AemContext newAemContext(){返回新
BundleContext bctx = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
欢迎提供任何帮助。您是否使用了任何特定的模拟框架以及模拟设置如何?我们使用wcm.io框架和AemContext builder类来填充对象。请在下面找到和平的代码,它可能有助于完全公开静态AemContext newAemContext(){返回新的AemContextBuilder().resourceResolverType(resourceResolverType.JCR_MOCK).plugin(WCMIO_SLING,WCMIO_CONFIG,WCMIO_HANDLER).afterSetUp(SETUP_CALLBACK).build()}在测试类中,我们通过以下行获取AemContext对象@Rule public final AemContext context=ServletAEMContext.newAemContext();