I\'ve got the following test:
@Test(expected = IllegalStateException.class) public void testKey() { int key = 1; this.finder(key); }
I had the same problem I just changed my imports statements. I removed :
import org.junit.jupiter.api.Test; import junit.framework.TestCase;
and added :
import org.junit.Test;
And it worked fine for me.