@Test public void AddTest_When_GivenNewNotExistingBeforeTodoEntityWithNameOnly_ExpectTrue(){ TodoEntity todoToAdd = new TodoEntity(); todoToAdd.setName("Test todoToAdd name"); assertThat(todoService.add(todoToAdd)).isTrue(); }
public boolean add(TodoEntity entity) { if(todoDAO.findByName(entity.getName())!=null) return false; entity.setStatus(TodoStatusType.OPEN); todoDAO.saveOrUpdate(entity); return true; }
TodoService { public boolean add(TodoEntity entity) { if(todoDAO.findByName(entity.getName())!=null) return false; entity.setStatus(TodoStatusType.OPEN); todoDAO.saveOrUpdate(entity); return true; } }
TodoService { public boolean add(TodoEntity entity) { if(todoDAO.findByName(entity.getName())!=null) return false; entity.setStatus(TodoStatusType.OPEN); todoDAO.saveOrUpdate(entity); return true; }  }
TodoService { public boolean add(TodoEntity entity) { if(todoDAO.findByName(entity.getName())!=null) return false; entity.setStatus(TodoStatusType.OPEN); todoDAO.saveOrUpdate(entity); return true; }  List<TodoEntity> getAll(); boolean add(TodoEntity entity); boolean edit(TodoEntity entity); boolean delete(long id); }
TodoService { public boolean add(TodoEntity entity) { if(todoDAO.findByName(entity.getName())!=null) return false; entity.setStatus(TodoStatusType.OPEN); todoDAO.saveOrUpdate(entity); return true; }  List<TodoEntity> getAll(); boolean add(TodoEntity entity); boolean edit(TodoEntity entity); boolean delete(long id);  }