@Test public void DeleteTest_When_GivenNonExistingTodoEntityId_ExpectFalse(){ long nonExistingId = 1; when(todoDAO.findById(nonExistingId)).thenReturn(null); assertThat(todoService.delete(nonExistingId)).isFalse(); }
public boolean delete(long id) { if(todoDAO.findById(id) == null) return false; todoDAO.delete(id); return true; }
TodoService { public boolean delete(long id) { if(todoDAO.findById(id) == null) return false; todoDAO.delete(id); return true; } }
TodoService { public boolean delete(long id) { if(todoDAO.findById(id) == null) return false; todoDAO.delete(id); return true; }  }
TodoService { public boolean delete(long id) { if(todoDAO.findById(id) == null) return false; todoDAO.delete(id); return true; }  List<TodoEntity> getAll(); boolean add(TodoEntity entity); boolean edit(TodoEntity entity); boolean delete(long id); }
TodoService { public boolean delete(long id) { if(todoDAO.findById(id) == null) return false; todoDAO.delete(id); return true; }  List<TodoEntity> getAll(); boolean add(TodoEntity entity); boolean edit(TodoEntity entity); boolean delete(long id);  }