Home > Enterprise >  Why does JUnit platform error appear when running a single test?
Why does JUnit platform error appear when running a single test?

Time:10-05

An error is thrown when running a single test: Failed to resolve org.junit.platform:junit-platform-launcher:1.7.0

The test is launched by clicking on the button in the form of a green triangle next to the name of the method.

But if you run testing of the whole project through maven (lifecycle -> test), then such an error is not visible, and all tests work quietly.

To use JUnit, this dependency is used:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
    <scope>test</scope>
</dependency>

The rest of the team who work on this project (one repository, different branches) do not have such problems. What can be causing this error? IDE used - IntelliJ IDEA

UPD: I've tried everything. Deleting the .idea folder had no effect, nor did re-downloading all dependencies. Clearing the cache also had no effect

UPD 2: Proxy is already specified

CodePudding user response:

Intellij IDEA > Preferences... > Appearance & Behavior > System Settings > HTTP Proxy

Change from No Proxy to Auto-detect proxy settings

CodePudding user response:

The issue was resolved by manually adding JUnit Platform Launcher files to the local repository. This is probably not the optimal solution, but it worked for me

  • Related