powermock.examples
Class MyServiceUser

java.lang.Object
  extended by powermock.examples.MyServiceUser

public class MyServiceUser
extends Object

A simple service class that uses the DependencyManager to get the MyService singleton instance. This is the class that we want to test. What's interesting in this example is the static call to the DependencyManager. Without byte-code manipulation (provided in this example by PowerMock) it would not be possible to return a mock from the call to

 DependencyManager.getInstance();
 
The purpose of this example is to demonastrate how to mock that static method.


Constructor Summary
MyServiceUser()
           
 
Method Summary
 int getNumberOfPersons()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyServiceUser

public MyServiceUser()
Method Detail

getNumberOfPersons

public int getNumberOfPersons()


Copyright © 2007-2012. All Rights Reserved.