@Test void test_delete_for_not_existing_employee() { boolean result = employeeRepository.delete(-1); assertThat(result).isFalse(); }
public boolean delete(long id) { String sqlQuery = "delete from employees where id = ?"; return jdbcTemplate.update(sqlQuery, id) > 0; }
EmployeeRepository { public boolean delete(long id) { String sqlQuery = "delete from employees where id = ?"; return jdbcTemplate.update(sqlQuery, id) > 0; } }
EmployeeRepository { public boolean delete(long id) { String sqlQuery = "delete from employees where id = ?"; return jdbcTemplate.update(sqlQuery, id) > 0; } @Autowired  EmployeeRepository(JdbcTemplate jdbcTemplate); }
EmployeeRepository { public boolean delete(long id) { String sqlQuery = "delete from employees where id = ?"; return jdbcTemplate.update(sqlQuery, id) > 0; } @Autowired  EmployeeRepository(JdbcTemplate jdbcTemplate); boolean exists(long id); Employee findOne(long id); List<Employee> findAll(); void save(Employee employee); long saveAndReturnId(Employee employee); long simpleSave(Employee employee); void update(Employee employee); boolean delete(long id); }
EmployeeRepository { public boolean delete(long id) { String sqlQuery = "delete from employees where id = ?"; return jdbcTemplate.update(sqlQuery, id) > 0; } @Autowired  EmployeeRepository(JdbcTemplate jdbcTemplate); boolean exists(long id); Employee findOne(long id); List<Employee> findAll(); void save(Employee employee); long saveAndReturnId(Employee employee); long simpleSave(Employee employee); void update(Employee employee); boolean delete(long id);  }