title: PowerMockito: how to mock methods called by the constructor?
body: <p>I have the following class:</p>
  
  <pre><code>public class Foo {
  
    public Foo() {
       initField1();
       initField2();
       initField3();
    }
  
  }
  </code></pre>
  
  <p>I need to change the behaviour (to mock) <code>initField1()</code> and <code>initField3()</code> for them making do nothing or something else that they actually do. I am interested in executing the actual code of initField2().</p>
  
  <p>I want to write the following test:</p>
  
  <pre><code>Foo foo = new Foo();
  assertTrue(foo.myGet());
  </code></pre>
  
  <p><code>myGet()</code> returns an attribute of Foo that has been computed by <code>initField2()</code>.</p>
  
  <p>The <code>initField()</code> methods are of course private.</p>
  
  <p>How can I do such a thing?</p>
  
  <p>Thanks for your help and best regards.</p>