junit error in system/console. | Community
Skip to main content
Level 3
Oct 16, 2015 2:26 AM UTC
Solved

junit error in system/console.

Hello 

Am getting error in system/console like 

junit.framework -- Cannot be resolved
junit.textui -- Cannot be resolved

I have added supporting dependencies also stil am getting this error .

That would be great for your reply.

 

Thanks,

Rahul

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
BrianKasingli
BrianKasingliAccepted solution
New Participant
Jul 17, 2023 10:29 PM UTC

If these are test dependencies, then make sure you flag these as test dependencies during the maven build. It looks like JUNIT should have never been deployed to your AEM environment. Also, please make sure your AEM has installed the latest service pack, so new dependencies can be resolved.

In other notes, this is how you would scope a dependency to be for tests only.

<dependencies> <!-- JUnit --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.13.2</version> <scope>test</scope> </dependency> <!-- Mockito --> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <version>3.12.4</version> <scope>test</scope> </dependency> <!-- AssertJ --> <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-core</artifactId> <version>3.21.0</version> <scope>test</scope> </dependency> <!-- Selenium WebDriver --> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>4.4.0</version> <scope>test</scope> </dependency> </dependencies>

1 reply

BrianKasingli
BrianKasingliAccepted solution
New Participant
Jul 17, 2023 10:29 PM UTC

If these are test dependencies, then make sure you flag these as test dependencies during the maven build. It looks like JUNIT should have never been deployed to your AEM environment. Also, please make sure your AEM has installed the latest service pack, so new dependencies can be resolved.

In other notes, this is how you would scope a dependency to be for tests only.

<dependencies> <!-- JUnit --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.13.2</version> <scope>test</scope> </dependency> <!-- Mockito --> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <version>3.12.4</version> <scope>test</scope> </dependency> <!-- AssertJ --> <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-core</artifactId> <version>3.21.0</version> <scope>test</scope> </dependency> <!-- Selenium WebDriver --> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>4.4.0</version> <scope>test</scope> </dependency> </dependencies>
Translate