It's probably something to do with the fact you have a local field called node
and a class variable called node
both of which are Node
classes and both of which are mocks.
I would remove the test local node
altogether, or rename it if you really want a test-local mock node
EDIT
My previous answer was wrong, and should really have been a comment. The hidden objects weren't causing any problems. (Although I still think they should have been removed/renamed)
The actual problem here is that the method you are trying to mock is final
and as such, can't be mocked.
When EasyMock mocks method/classes, it does so by extending and overriding them. So final classes and final methods cannot be mocked with EasyMock as they can't be overridden.
The call to the getParentNode()
method is not mocked and as such isn't registered during the record state within the expectation call.