java.lang.NoSuchMethodError: ‘org.junit.jupiter.api.extension.TestInstances org.junit.jupiter.api.extension.ExtensionContext.getRequiredTestInstances()’

Problem:

java.lang.NoSuchMethodError:

'org.junit.jupiter.api.extension.TestInstances org.junit.jupiter.api.extension.ExtensionContext.getRequiredTestInstances()'

Using :

openJdk16

maven3

eclipse2021-03

 

Solution:

I was using maven dependency for Junit 5

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.3.0</version>
<scope>test</scope>
</dependency>

And to solve this issue I had to update the dependency to

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.5.0</version>
<scope>test</scope>
</dependency>

 

After that change eclipse did run the tests fine.

T Tak

Hey ! I'm Tak. I'm a software developer since 2008 and been programming since I was 17 years, started with pascal. I love programming, teaching and building stuff on web.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.