I have method getAllCustomers
inside CustomerService
class. Inside this method I call another static method from CustomerDao
class.
Now when I am writing the junit for method getAllCustomers
inside customerService
class, where I want to mock the call to
static method of CustomerDao
i.e. getAllCustomers
. Here is the brief code snippet of method getAllCustomers
inside
CustomerService
class. Is it possible to mock the static method call using unitils?
Public static List<CustomerDate> getAllCustomers()
{
//some operations
List<CustomerDate> customers=CustomerDao.getAllCustomers();// static method inside CustomerDao
//some operations
}
Above code is just an example I am trying to put. Please avoid the discussion why these methods are designed as static methods. That's a separate story .)