Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

Test cases are failing after updating the mockito core dependency

Avatar

Community Advisor

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

2 Replies

Avatar

Community Advisor

Hi @sravs ,

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

Avatar

Correct answer by
Community Advisor

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