Java Mockito.spy VerifyError:构造函数必须调用super()或this()

Java Mockito.spy VerifyError:构造函数必须调用super()或this(),java,mocking,mockito,Java,Mocking,Mockito,我正在尝试执行简单的测试用例,但出现了一个错误。下面是我的测试用例: @Rule public AemContext context = new AemContext(); @Test public void test() throws Exception { Resource currentResource = context .create() .resource("/content/app/en-us/page", "jcr:title", "Tit

我正在尝试执行简单的测试用例,但出现了一个错误。下面是我的测试用例:

@Rule
public AemContext context = new AemContext();
@Test
public void test() throws Exception {
    Resource currentResource = context
        .create()
        .resource("/content/app/en-us/page", "jcr:title", "Title Page", "width", "5","height","9");
    inheritanceValueMap = Mockito.spy(new HierarchyNodeInheritanceValueMap(currentResource));
    Assert.assertThat(inheritanceValueMap.getInherited("width", StringUtils.EMPTY), Is.is("5"));
}
我得到的错误是:

java.lang.VerifyError:(class:com/day/cq/commons/ValueMapWrapper,方法:signature:(Lorg/apache/sling/api/resource/ValueMap;)V)构造函数必须调用super()或this()


有什么解决方案吗?

当我们使用uber jar的以下依赖项时,通常会出现这个问题:

<dependency>
   <groupId>com.adobe.aem</groupId>
   <artifactId>uber-jar</artifactId>
   <version>6.2.0</version>
   <classifier>obfuscated-apis</classifier>
   <scope>provided</scope>
</dependency>

com.adobe.aem
优步罐
6.2.0
模糊API
假如
尝试将依赖项分类器更改为API,如下所示:

<dependency>
   <groupId>com.adobe.aem</groupId>
   <artifactId>uber-jar</artifactId>
   <version>6.2.0</version>
   <classifier>apis</classifier>
   <scope>provided</scope>
</dependency>

com.adobe.aem
优步罐
6.2.0
原料药
假如

我们使用的版本是6.1.0,如果我们像使用AEM6.1版本那样使用6.2.0是否安全?此外,如果我应用更改,许多依赖项将无法在我的文件中得到解析。这取决于您使用aem版本的要求。此修复程序适用于AEM 6.2,我需要检查6.1