@Test public void testAddFavorites() throws Exception { Mockito.doReturn(Collections.emptyList()).when(favoritesRepository).addFavorite(Mockito.any(), Mockito.any()); Favorites favorites = new FavoritesImpl(favoritesRepository); UserInfo.Username user = UserInfo.Username.valueOf("TestUser"); Experiment.ID id = Experiment.ID.newInstance(); favorites.addFavorite(user, id); Mockito.verify(favoritesRepository).addFavorite(user, id); }
@Override public List<Experiment.ID> addFavorite(UserInfo.Username username, Experiment.ID experimentID) { return favoritesRepository.addFavorite(username, experimentID); }
FavoritesImpl implements Favorites { @Override public List<Experiment.ID> addFavorite(UserInfo.Username username, Experiment.ID experimentID) { return favoritesRepository.addFavorite(username, experimentID); } }
FavoritesImpl implements Favorites { @Override public List<Experiment.ID> addFavorite(UserInfo.Username username, Experiment.ID experimentID) { return favoritesRepository.addFavorite(username, experimentID); } @Inject  FavoritesImpl(final FavoritesRepository favoritesRepository); }
FavoritesImpl implements Favorites { @Override public List<Experiment.ID> addFavorite(UserInfo.Username username, Experiment.ID experimentID) { return favoritesRepository.addFavorite(username, experimentID); } @Inject  FavoritesImpl(final FavoritesRepository favoritesRepository); @Override List<Experiment.ID> getFavorites(UserInfo.Username username); @Override List<Experiment.ID> addFavorite(UserInfo.Username username, Experiment.ID experimentID); @Override List<Experiment.ID> deleteFavorite(UserInfo.Username username, Experiment.ID experimentID); }
FavoritesImpl implements Favorites { @Override public List<Experiment.ID> addFavorite(UserInfo.Username username, Experiment.ID experimentID) { return favoritesRepository.addFavorite(username, experimentID); } @Inject  FavoritesImpl(final FavoritesRepository favoritesRepository); @Override List<Experiment.ID> getFavorites(UserInfo.Username username); @Override List<Experiment.ID> addFavorite(UserInfo.Username username, Experiment.ID experimentID); @Override List<Experiment.ID> deleteFavorite(UserInfo.Username username, Experiment.ID experimentID);  }