While i run the mvn install I'm able to find this above error .
This is my POM.xml i have configured JUnit.
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
This is the service Test class
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class ServiceTestCase {
protected static final Logger LOG = Logger.getLogger(ServiceTestCase.class);
@Configuration
static class AccountServiceTestContextConfiguration {
....
....
....
}
While compiling the above error I am getting. this Test class I have created in src/test/java
can any one please suggest. How to resolve this ?
When I remove the I am getting error as @Test is not recognise.
Ok, the solution might be quite simple: Update to JUnit 4.5 (or higher).
The javadoc of the BlockJUnit4Runner (which is the Superclass of the SpringJUnit4ClassRunner you are using) states:
@since 4.5
...but as you only use <version>4.4</version>
, that's probably the whole problem. Just checked it and the class does simply not exist in JUnit 4.4, so you'll have to upgrade your JUnit version to fix that problem.
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