@Test public void shouldDeleteARegisteredUser() throws NotFoundException { User user = createUser(); BDDMockito.given(userRepository.findById(user.getId())).willReturn(Optional.of(user)); userDAO.delete(dummyAdmin, user.getId()); Mockito.verify(userRepository).delete(user); }
public void delete(User authUser, Long id) throws NotFoundException { delete(authUser, getById(id)); }
UserDAO { public void delete(User authUser, Long id) throws NotFoundException { delete(authUser, getById(id)); } }
UserDAO { public void delete(User authUser, Long id) throws NotFoundException { delete(authUser, getById(id)); } @Autowired  UserDAO(UserRepository userRepository, FileDAO fileDAO, ProjectDAO projectDAO,
                   ProjectRepository projectRepository); }
UserDAO { public void delete(User authUser, Long id) throws NotFoundException { delete(authUser, getById(id)); } @Autowired  UserDAO(UserRepository userRepository, FileDAO fileDAO, ProjectDAO projectDAO,
                   ProjectRepository projectRepository); void create(User newUser); List<User> getAll(); List<User> getAllByRole(UserRole role); User getById(Long id); User getByEmail(String email); User getByUsername(String username); void update(User user); void delete(User authUser, Long id); void delete(User authUser, List<Long> userIds); }
UserDAO { public void delete(User authUser, Long id) throws NotFoundException { delete(authUser, getById(id)); } @Autowired  UserDAO(UserRepository userRepository, FileDAO fileDAO, ProjectDAO projectDAO,
                   ProjectRepository projectRepository); void create(User newUser); List<User> getAll(); List<User> getAllByRole(UserRole role); User getById(Long id); User getByEmail(String email); User getByUsername(String username); void update(User user); void delete(User authUser, Long id); void delete(User authUser, List<Long> userIds);  }