I\'m interested to know about how to test Akka Actor functionality, by mocking some methods (substitute real object\'s/actor\'s method implementation by moc
So I'm probably not understanding the question but you probably don't want to mock an actor as the purpose of mocking is to replace something like a dao with a test copy that has expectations of invocation - actor doesn't really fit the bill as it's something you extend rather than a dependency - mocking really only applies to real dependencies.
TestActorRef specifically gives you access to the underlying actor - in most normal circumstances you can only send messages to an actor and not invoke anything directly on it. TestActoRef removes this limitation by allowing you to access your real true extension of Actor instead of just the ActorRef that you can only ! or ? against (send or ask).
I'm a scala dev so the insight is hopefully agnostic. I don't know the java api specifically but it shouldn't matter.
My recommendation is to get the real Actor object via actor ref and just test the method or figure out some way to get test coverage through real messages.