@Test @SuppressWarnings("unchecked") public void removeAllBookmarksOfUser() { Set<Project> bookmarksMock = mock(Set.class); given(userMock.getBookmarks()).willReturn(bookmarksMock); bookmarkService.removeAllBookmarksOfUser(userMock); verify(bookmarksMock).clear(); verify(userRepository).save(userMock); }
@Override public void removeAllBookmarksOfUser(User user) { user.getBookmarks().clear(); userRepo.save(user); }
RepositoryBookmarkService implements BookmarkService { @Override public void removeAllBookmarksOfUser(User user) { user.getBookmarks().clear(); userRepo.save(user); } }
RepositoryBookmarkService implements BookmarkService { @Override public void removeAllBookmarksOfUser(User user) { user.getBookmarks().clear(); userRepo.save(user); } @Autowired  RepositoryBookmarkService(UserRepository userRepo); }
RepositoryBookmarkService implements BookmarkService { @Override public void removeAllBookmarksOfUser(User user) { user.getBookmarks().clear(); userRepo.save(user); } @Autowired  RepositoryBookmarkService(UserRepository userRepo); @Override Project addBookmarkToUser(User user, Project project); @Override void removeBookmarkOfUser(User user, Project project); @Override @Transactional(readOnly = true) List<Project> getBookmarksOfUser(User user); @Override @Transactional(readOnly = true) boolean userHasBookmark(User user, Project project); @Override void removeAllBookmarksOfUser(User user); }
RepositoryBookmarkService implements BookmarkService { @Override public void removeAllBookmarksOfUser(User user) { user.getBookmarks().clear(); userRepo.save(user); } @Autowired  RepositoryBookmarkService(UserRepository userRepo); @Override Project addBookmarkToUser(User user, Project project); @Override void removeBookmarkOfUser(User user, Project project); @Override @Transactional(readOnly = true) List<Project> getBookmarksOfUser(User user); @Override @Transactional(readOnly = true) boolean userHasBookmark(User user, Project project); @Override void removeAllBookmarksOfUser(User user);  }