Author Login
Post Reply
Hi,
I am new to Jmock.
Could you please tell me how to test below code?
publi Interface AccountWebService
{
void addAccount(String accountDetails) throws Exception;
}
public class AccountWebServiceImpl implements AccountWebService
{
public void addAccount(final String accountDetails) throws Exception
{
// Here web service actual implementation.
}
}
public Interface AccountManager
{
void addAccount(String accountDetails) throws Exception;
// Some other methods
}
public class AccountManagerImpl implements AccountManager
{
public AccountManagerImpl()
{
}
public void addAccount(String accountDetails) throws Exception
{
AccountWebService accountService = new AccountWebServiceImpl();
// In some cases getting web service implementation with static
methods.
//Do validation on input parameter.
//.......
accountService.addAccount(somerequest)
}
}
How to mock AccountWebService here?
If we are creating objects within method instead of passing as parameters ,
How to test?
Thanks,
Guru
--
Sent from the jMock - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email