0

I have two classes of this structure:

public class Class1 extends Thread
{
  public void Run() { //basically starting the timer }

  private class Class2 extends TimerTask 
  {
    private void Method1 ();
    private void Method2 ();
  }
}

I want to Unit Test the methods of Class2 somehow, because thats where all the data is processed. How should I do that using JUnit?

  • 2
    possible duplicate of [How to test a class that has private methods, fields or inner classes](http://stackoverflow.com/questions/34571/how-to-test-a-class-that-has-private-methods-fields-or-inner-classes) – gpinkas Sep 15 '15 at 12:56

1 Answers1

0

To access private method or member you have to use reflection API.

RickyGo
  • 166
  • 7