I have a package using spring dependency injection for its unit tests using following code.
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "<xml_location>" })
@WebAppConfiguration
I need to add a static method in the util class and need to mock it to prevent existing unit tests to fail. I tried using PowerMock but getting different errors like the following ones.
<class_name> not prepared for test.
org.powermock.api.mockito.ClassNotPreparedException
Failed to load ApplicationContext
Can someone please point to an example where this was done before?