This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • 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 Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

PowerMock issues

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Mockito+TestNG framework in my Project. It is used to work fine but to mock some static methods I injected PowerMock Libraries in my classpath and updated the code to use PowerMock(libraries screenshot MockDependencies.PNG attached). I am finding that whenever I try to execute : PowerMockito.doNothing().when(CustomImportUtil.class, "init", serviceMgr);
test case fails while initializing mockobject [s = mock(Service.class);] with error message :

-------------------------------------
Below is my sample java test class. Kindly help me to resolve this issue.

----------



MockDependencies.PNG
[Thumbnail for MockDependencies.PNG]
Description of mock jars and TestNG framework
 
Marshal
Posts: 5127
320
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Nitesh, welcome to the Ranch!

I moved your post into our Testing forum to help you get the right response to your question. I also added code tags to your post to make your code examples easier to read, which is another top tip to help you get your question answered. (Read --> UseCodeTags)
reply
    Bookmark Topic Watch Topic
  • New Topic