@brijesht7477132 Unfortunately, I don't have such project at the moment to test it myself, I'm posting few trial-and-error solutions at my best - please bear with me 😉
<dependency>
<groupId>com.google.code.gson<groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
<scope>test</scope>
</dependency>Or do you have any sample project to share with me?
Hi @santoshsai ,
I figured out what is causing the issue. It's the AEM Uber Jar. Things are working fine until I added the Uber Jar dependency. We are using AEM 6.4.8 version and it seems that the Uber jar version 6.4.8 using Gson transitive dependency of 2.8.2 version and while running the test case it is picking the version 2.8.2.
I fixed it by simply changing the order of including dependency where Gson dependency is included first and after that Uber Jar dependency. Showing sample below. That solves my issue of test case failing.
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>6.4.8</version>
<classifier>apis</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.