That's what pom.xml include:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
That's actual test code:
import org.junit.Assert.*; // Cannot resolve symbol 'Assert'
public class CalculatorTest {
@org.junit.Test // Cannot resolve symbol 'Test'
public void add() {
Assert.assertEquals(5.0, 5.0, 0.01); // Cannot resolve symbol 'Assert'
}
}
Building Project just says that it cannot fine symbol 'Assert'. I tried Alt Enter -> Add 'JUnit4' to classpath but it only doubles the dependency in pop.xml.
CodePudding user response:
Try this (and it appears it worked as per OP's comment):
File->Invalidate Caches
- check all boxes except
Ask before downloading...
Invalidate and Restart