I am getting the below compiler error:
Type mismatch: cannot convert from Class<SpringRunner> to Class<? extends Runner>
From this code:
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@DataMongoTest
public class ReservationEntityTest {
I don't understand the error Class<SpringRunner>
has SpringRunner
that extends Runner
.
What am I missing?.
The actual response was the one of @M. Demiun in the comments;
"Remove your junit dependency from the pom.xml. You are using an ancient version. The spring-boot-starter-test includes all dependencies needed. I would even suggest to remove the @RunWith and use the @Test from JUnit5 (the @DataMongoTest already shouldinclude the @ExtendWith from JUnit5."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With