public Task findTaskById(Long id) {
if (taskDAO.existsById(id)) {
return taskDAO.findById(id).get();
}
return null;
}
@Test
public void test_findTaskById() {
taskDAO = Mockito.mock(TaskDAO.class, Mockito.RETURNS_DEEP_STUBS);
when(taskDAO.existsById(12345L)).thenReturn(true);
instance.findTaskById(1234567890L);
}
taskDAO为空。需要帮助以获取taskDAO的一些模拟值