I am using sts but also using mvn clean install on the command line. I created this simple to test as an example.
import org.junit.Test;
import junit.framework.TestCase;
public class QuickTest extends TestCase {
@Test(expected = Exception.class)
public void test() {
throwsException();
}
private void throwsException() throws Exception {
throw new Exception("Test");
}
}
My STS (Eclipse) IDE complains that the line calling the method testThrowsException(); unhandled exception type Exception.
If I try to run the test I get the same error
java.lang.Error: Unresolved compilation problem:
Unhandled exception type Exception
What am I doing wrong?