title: Verifying specific abstract constructor of parent is invoked
body: <p>In the code base I have the following structure:</p>
  
  <pre><code>abstract class Bar{
  
      public Bar(){
          ....
      }
  
      ....        
  
      public Bar(int x, int y){
  
      }
  
      ....
  }
  </code></pre>
  
  <p><code>Bar</code> is then extended by <code>Foo</code>.</p>
  
  <pre><code>abstract class Foo extends Bar{
  
      public Foo(){
        super();
  
          ....
      }
  
      public Foo(int x){
        super(x,0);  // call parent's specific constructor
        ....
      }
  
      ....
  }
  </code></pre>
  
  <p>I have tried the following jUnit test case, which cannot compile:</p>
  
  <pre><code>class FooTest{
  
      Foo _foo;
  
      @Test
      void testFooConstructor(){
          new Expectations(){
              Bar bar;
              {
                  bar = new Bar(anyInt,0); // error, obviously Bar cannot be instantiated.
              }
          }
  
          _foo = new Foo(anyInt){ // empty implementation
              //Override any abstract methods
          }
      }
  
  }
  </code></pre>
  
  <p>I have written the above approach because I saw <a href="https://stackoverflow.com/questions/8060735/jmockit-how-to-expect-constructor-calls-to-mocked-objects">this SO question</a>, but the abstract class may not be initiated, and hence it fails.</p>
  
  <p>Additionally, I have also tried:</p>
  
  <pre><code>class FooTest{
  
      Foo _foo;
  
      @Test
      void testFooConstructor(){
  
          _foo = new Foo(anyInt){ // empty implementation
              //Override any abstract methods
          }
  
          new Expectations(){
              Bar bar;
              {
                  invoke(bar,"Bar",anyInt,0); //Invocations.invoke
              }
          }
  
          invoke(_foo,"Foo",anyInt);
      }
  
  }
  </code></pre>
  
  <p>However, my test result is:</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: No compatible method found: Bar(int,int)
      at unit.src.com.test.FooTest$1.(line number)</p>
  </blockquote>
  
  <p>How can I achieve the desired result? Is there a way to implement this test?</p>