• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

integrating SpringContextTests with PowerMock

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic