title: Ignoring stacktrace when testing for exceptions in Junit
body: <p>We are testing for exceptions in our unit tests</p>
  
  <pre><code>@Test(expected=IOException.class)
       public void test() {
       // run some code that throws IOException.
  }
  </code></pre>
  
  <p>The test is passing but as a part of the maven build that runs the test, the stacktrace comes in the console output.
  Is there anyway in which this stacktrace can be ignored in the tests.</p>