I have a straightforward method to test. I tested all my other methods that return a custom object and they're working fine.
@Autowired Dao dao;
public ResultSetList getResultSetList(String f, String t) {
ResultSetList res = dao.getResultst(f, t);
return res;
}
@Mock
private ResultSet rs;
@Test
public void testGetResultSetList() {
ResultSetList rsl = new ResultSetList(rs, 0, 0, true); // npe here
Mockito.when(dao.getResults(any(), any())).thenReturn(rsl);
ResultSetList rsFinal = service.getResultSetList("", "");
Assertions.assertThat(rsFinal).isNotNull();
}