lundi 29 février 2016

Is there a way I can return a List of VO's by passing a VO using JMockit?

I am trying to get a List of VO's based on a search Criteria where I am passing a VO as an argument. For Example:

I am setting the values of a DummyVO and then passing that as an argument. Here is the complete code.

DummyVO dummyVO;
ActualVO actualVO;

@Before
public void setup(){
this.dummyVO.setId("1");
this.dummyVO.setVersion(2);

this.actualVO.set....
this.actualVO.set....

}

After this, I am trying to test If I am getting a list of VO's(at this point, just one VO). The search method runs a query behind the scenes( select * from VO where id = "");

@Test
public void testDAO() throws Exception{

List<ActualVO> mockVOList = compositeDAO.getSearchCriteria(this.dummyVO);

}

However its returning an empty list. I am not sure what's the problem. It is supposed to return the ActualVO. Please let me know if there is a better way to do this.

Thanks

Aucun commentaire:

Enregistrer un commentaire