Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

Test cases are failing after updating the mockito core dependency

Avatar

Level 4

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
Level 4

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

Level 5

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
Level 4

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