2 Jul 11:57
How to test a method that is wrapped in a private method?
From: sparks <ychen.lu@...>
Subject: How to test a method that is wrapped in a private method?
Newsgroups: gmane.comp.java.jmock.user
Date: 2008-07-02 09:58:20 GMT
Subject: How to test a method that is wrapped in a private method?
Newsgroups: gmane.comp.java.jmock.user
Date: 2008-07-02 09:58:20 GMT
Hi all,
I am quite new to jMock and I am using jMock 2.4.0.
I am testing a service class which uses a
DAO object to read and write data and
the DAO object has been mocked out.
The service has a private method which delegates
all the calls to the DAO
object. The code is like following:
public class ServiceClass {
private DAO dao;
public void aOperation(){
//some logics here
updateData(data);
}
public void anotherOperation(){
//some other logics here
updateData(data);
}
private void updateData(Data someData){
//pre processing......
dao.update(someData);
//post processing......
(Continue reading)
RSS Feed