WCmUse / WCMUsePojo mocking in Junit | Adobe Higher Education
Skip to main content
Shivamurthy_MN
Level 2
March 30, 2016
Resuelto

WCmUse / WCMUsePojo mocking in Junit

  • March 30, 2016
  • 4 respuestas
  • 2849 visualizaciones

Hi All,
Have anybody implemented JUnit test cases for classes which are extending to WCMUsePojo?
I am getting below error while mocking WCMUsePojo..

java.lang.VerifyError: Constructor must call super() or this() before return
Exception Details:
Location:
com/adobe/cq/sightly/WCMUsePojo.<init>()V @9: return
Please provide some inputs why this exception.
FYI : I am using Mockito for mocking.

Thanks in Advance.

Este tema ha sido cerrado para respuestas.
Mejor respuesta de Peter_Puzanovs

Hey Shiva,

Looks like you need to use unobfuscated uber jar to run this unit test [1](otherwise it won't compile and you would get the error you are getting now)

[1] https://docs.adobe.com/docs/en/aem/6-1/develop/dev-tools/ht-projects-maven.html#I%20understand%20there%20are%20two%20different%20versions%20of%20the%20UberJar%20available.%20Can%20you%20explain%20the%20difference%20between%20them?

Regards,

Peter

4 respuestas

Peter_Puzanovs
Community Advisor
Community Advisor
March 30, 2016

Hey Shiva,

Looks like you need to use unobfuscated uber jar to run this unit test [1](otherwise it won't compile and you would get the error you are getting now)

[1] https://docs.adobe.com/docs/en/aem/6-1/develop/dev-tools/ht-projects-maven.html#I%20understand%20there%20are%20two%20different%20versions%20of%20the%20UberJar%20available.%20Can%20you%20explain%20the%20difference%20between%20them?

Regards,

Peter

Shivamurthy_MN
Level 2
April 1, 2016

Hello Peter,

Thank you for the information..

 

Regards,

Shivamurthy MN

November 14, 2017

HI PuzanovsP​,

Thanks for posting, it helps me also.

ravitejakolla
Level 2
May 13, 2018

Hi,

I'm facing similar issue after 6.3 upgrade even though i'm using obfuscated-apis. 

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

  <artifactId>uber-jar</artifactId>

  <version>6.3.0</version>

  <classifier>obfuscated-apis</classifier>

  <scope>provided</scope>

java.lang.VerifyError: Constructor must call super() or this() before return

Exception Details:

  Location:

    com/adobe/cq/sightly/WCMUsePojo.<init>()V @1: return

  Reason:

    Error exists in the bytecode

  Bytecode:

    0x0000000: 2ab1