Hi,
PowerMock doesn't have full support for inner classes yet. But since you requested the feature (well indirectly anyway) I've made it a bit easier for you. The reason why you got the IllegalAccessError was because the inner classes was not prepared for test using the @PrepareForTest annotation which may seem a bit strange. You could of course add the inner classes by specifying their fully-qualified names using the "fullyQualifedNames" attribute in the PrepareForTest annotation, e.g. @PrepareForTest(fullyQualifiedNames={"com.myapp.InnerInterface", "com.myapp.InnerClass"}). But even if you do that the interface would still be loaded by the wrong class-loader (because of a bug). So what I've done is to automatically prepare all inner member classes of class X if you prepare X for test which is probably what most people want anyway. If not you could always fallback to using the @PrepareOnlyThisForTest annotation. I've also added three new methods to the Whitebox class, these are Whitebox.getInnerClassType(..), Whitebox.getLocalClassType(..) and Whitebox.getAnonymousInnerClassType(..). These methods may help you with getting the class type for private inner, local or anonymous inner classes. So if you like you can check out the source from trunk using "svn checkout
http://powermock.googlecode.com/svn/trunk/ powermock-read-only" and then do mvn install and give it a go. It would provide great feedback for us if you could do so and report back whether it works or not for you. You could check out
http://code.google.com/p/powermock/source/browse/trunk/modules/module-test/powermock/junit4-test/src/test/java/samples/junit4/classwithinnermembers/ClassWithInnerMembersTest.java for an example.
Thanks for pointing this out,
Johan