title: PrivateMethodTester and Inheritance
body: <p>So I have a class:</p>
  
  <pre><code>class MyParent {
      private def myMethod() = 12
  }
  </code></pre>
  
  <p>And a class:</p>
  
  <pre><code>class MyChild extends MyParent {
  }
  </code></pre>
  
  <p>In my test I want to do:</p>
  
  <pre><code>val c = new MyChild()
  
  val m = PrivateMethod[MyChild]('myMethod)
  assertEquals(12, c invokePrivate m())
  </code></pre>
  
  <p>But I get:</p>
  
  <pre><code>java.lang.IllegalArgumentException: Can't find a private method named: myMethod
  </code></pre>
  
  <p>Any idea how to test the <code>method</code> defined in the <code>parent</code> using the <code>child</code> class ? </p>
  
  <p>My use case is obviously more complex, so testing the parent method is different than testing the child method. </p>
  
  <p>Thank you. </p>
  
  <p><strong>Edit</strong>:</p>
  
  <p>One solution I found is to change <code>MyParent#myMethod</code> to <code>protected</code> and then have in the child:</p>
  
  <pre><code>private def wrapMyMethod() = super.myMethod()
  </code></pre>