title: JUnit @Test expected annotation not working
body: <p>I've got the following test:</p>
  
  <pre><code>@Test(expected = IllegalStateException.class)
  public void testKey() {
      int key = 1;
      this.finder(key);
  }
  </code></pre>
  
  <p>But JUnit reports, that the test fails, although it throws — as expected — an <code>IllegalStateException</code>.</p>
  
  <p>Do I have to configure something else to make this run?</p>
  
  <hr>
  
  <p>I run the test now with</p>
  
  <pre><code>@RunWith(Suite.class)
  @SuiteClasses(Test.class)
  public class TestSuite {
  
  }
  </code></pre>
  
  <p>like in <a href="https://stackoverflow.com/questions/5536448/how-to-create-a-junit-4-test-suite-to-pass-when-expected-exceptions-are-thrown">this question</a>, but am still not getting the desired result.</p>
  
  <p>And when I remove the <code>test</code> prefix I'm still getting an error. </p>
  
  <p>I gotta say that I run these tests with Eclipse, but it's configured to use the JUnit 4 Runner.</p>