Test cases are failing after updating the mockito core dependency | Community
Skip to main content
sravs
Community Advisor
Community Advisor
March 6, 2023
Solved

Test cases are failing after updating the mockito core dependency

  • March 6, 2023
  • 1 reply
  • 1493 views

After updating the mockito core dependency to the latest version my test cases are failing. getting below error.

 

java.lang.IllegalArgumentException: Illegal page name.

at io.wcm.testing.mock.aem.MockPageManager.create(MockPageManager.java:100)
at io.wcm.testing.mock.aem.builder.ContentBuilder.page(ContentBuilder.java:148)
at io.wcm.testing.mock.aem.builder.ContentBuilder.page(ContentBuilder.java:173)

 

Can you please help me with this.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by sravs

Thanks for your reply @tarunkumar , I'm able to resolve the issue by updating other dependencies as mentioned below.

 

<dependency> <groupId>org.junit</groupId> <artifactId>junit-bom</artifactId> <version>5.9.1</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-junit-jupiter</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>io.wcm</groupId> <artifactId>io.wcm.testing.aem-mock.junit5</artifactId> <version>5.1.0</version> <scope>test</scope> </dependency>

Thanks

Sravani

1 reply

TarunKumar
Community Advisor
Community Advisor
March 9, 2023

Hi @sravs ,

Can you share the screen shot of the pom as how you have injected the mockito for better clarity.

sravs
Community Advisor
sravsCommunity AdvisorAuthorAccepted solution
Community Advisor
March 10, 2023

Thanks for your reply @tarunkumar , I'm able to resolve the issue by updating other dependencies as mentioned below.

 

<dependency> <groupId>org.junit</groupId> <artifactId>junit-bom</artifactId> <version>5.9.1</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-junit-jupiter</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>io.wcm</groupId> <artifactId>io.wcm.testing.aem-mock.junit5</artifactId> <version>5.1.0</version> <scope>test</scope> </dependency>

Thanks

Sravani