I have following public class in Java which looks like:
public class MyClass
{
private static class MyNestedClass<T> extends SomeOtherClass
{
}
}
I am writing a test where I need to create a mock object for MyNestedClass class using PowerMockito, but am not able to access the class since it's private. Is there a way I can access MyNestedClass?
I tried the following:
MyClass.MyNestedClass myNestedClass = new MyClass.MyNestedClass()
and
MyClass testNoteActivity = Mockito.spy(MyClass.class);
testNoteActivity.MyNestedClass myNestedClass = new testNoteActivity.MyNestedClass()
Both didn't work for me.