This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Testing and the fly likes integrating SpringContextTests with PowerMock Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "integrating SpringContextTests with PowerMock" Watch "integrating SpringContextTests with PowerMock" New topic
Author

integrating SpringContextTests with PowerMock

Max Ulanovskiy
Greenhorn

Joined: Aug 01, 2009
Posts: 3
Hi,
faced the problem while integrating PowerMock and Spring dependency injection for test cases. For example, we have a field in test which is autowired like this:

mock is a bean configured in tests-context.xml

Next I want to use some tricks of PowerMock for my mock object. To do this I should apply annotations
to MyTest class, but when I do this I'm getting NPE when I call mock. I suppose that PowerMockRunner.class and AbstractJUnit4SpringContextTests are in conflicted state...
Is there any standard way to solve this problem?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: integrating SpringContextTests with PowerMock
 
Similar Threads
PowerMock Test mechanism error
mocking private static methods with PowerMock
Problem creating mock using PowerMock
powermock : ProcessBuilder redirectErrorStream giving nullPointerException
PowerMock: StackOverFlow