Highlighted

Constructor must call super() or this() Junit

vdhim23

14-06-2017

Hi,

I am trying to execute simple test case, but getting an error. Below is my test case :

@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"));

}

Error I am getting is :

java.lang.VerifyError: (class: com/day/cq/commons/ValueMapWrapper, method: <init> signature: (Lorg/apache/sling/api/resource/ValueMap;)V) Constructor must call super() or this()

Any solution to this?

Thanks,

Replies

Highlighted

ekta_aggarwal

14-06-2017

Hi,

This issue usually comes when we use below dependency of 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>

Try changing the dependency classifier to apis , as shown below:

<dependency>

   <groupId>com.adobe.aem</groupId>

   <artifactId>uber-jar</artifactId>

   <version>6.2.0</version>

   <classifier>apis</classifier>

   <scope>provided</scope>

</dependency>