JUnit : java.lang.NoSuchMethodError: javassist.CtMethod.hasAnnotation(Ljava/lang/Class;)Z

Usually you would get this error while running test cases using Mockito and PowerMock, it uses the javaassist library for executions.

Possible cause:
         1) Missing dependency of javaassist jar
         2) Mismatch in version of javaassist

Fix:
         1) Add/Update maven dependency (if you are using maven).
         2) Download the jar file of javaassist and add it to the project's build path libraries.

Comments

Popular posts from this blog

How to Run Python Script in PM2 Server

Handling Performance Bottlenecks in Spring Applications

Retry in SprinBoot Application