Possible Duplicate:
jmock mocking a static method
I am working on a legacy unit test which uses static methods of a class XX. I have now changed the class to get a field value from Spring application context. The unit test now fail as the class XX cannot be initialized.
I cannot wrap the class XX with a dummysupport class since the logic to be tested is complex and the call to class XX is nested within multiple layers of calls to other legacy classes. So i am trying to find a way to mock the static methods within the class class XX. Is there a way do this? I am using Jmock library.