title: PowerMock's expectNew() isn't mocking a constructor as expected
body: <p>I'm trying to learn the ins and outs of various mocking libraries and <a href="http://code.google.com/p/powermock/" rel="noreferrer">PowerMock</a>(specifically the EasyMock extension) is next on the list. I'm attempting to mock a constructor and the examples provided don't have the same response when I try to replicate them. As far as I can tell, it never mocks the constructor and just proceeds as if it were normal.</p>
  
  <p>This is the test class:</p>
  
  <pre class="lang-java prettyprint-override"><code>@RunWith(PowerMockRunner.class)
  @PrepareForTest({Writer.class})
  public class FaultInjectionSituationTest {
  
      @Test
      public void testActionFail() throws Exception {
          FaultInjectionSituation fis = new FaultInjectionSituation();
          PowerMock.expectNew(Writer.class, "test")
             .andThrow(new IOException("thrown from mock"));
          PowerMock.replay(Writer.class);
          System.out.println(fis.action());
          PowerMock.verify(Writer.class);
      }
  
  }
  </code></pre>
  
  <p>I've tried replacing the "test" with an EasyMock.isA(String.class), but it yielded the same results.</p>
  
  <p>This is the FaultInjectionSituation:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class FaultInjectionSituation {
  
      public String action(){
          Writer w;
          try {
              w = new Writer("test");
          } catch (IOException e) {
              System.out.println("thrown: " + e.getMessage());
              return e.getLocalizedMessage();
          }
          return "returned without throw";
      }
  }
  </code></pre>
  
  <p>The "Writer" is nothing more than a shell of a class:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class Writer {
      public Writer(String s) throws IOException {
      }
  
      public Writer() throws IOException{
      }
  }
  </code></pre>
  
  <p>When the test is run, it prints out "returned without throw", indicating the exception was never thrown.</p>