@Test public void testGetUserFeedback() throws Exception { FeedbackImpl feedbackImpl = new FeedbackImpl(feedbackRepository, userDirectory); verifyException(feedbackImpl, NullPointerException.class).getUserFeedback(null); UserInfo.Username username = UserInfo.Username.valueOf("name"); List<UserFeedback> userFeedbackList = new ArrayList<>(); userFeedbackList.add(userFeedback); when(feedbackRepository.getUserFeedback(username)).thenReturn(userFeedbackList); List<UserFeedback> result = feedbackImpl.getUserFeedback(username); assert (userFeedbackList.equals(result)); doThrow(RepositoryException.class).when(feedbackRepository).getUserFeedback(username); verifyException(feedbackImpl, RepositoryException.class).getUserFeedback(username); }
@Override public List<UserFeedback> getUserFeedback(UserInfo.Username username) { checkNotNull(username, "Parameter \"username\" cannot be null"); return feedbackRepository.getUserFeedback(username); }
FeedbackImpl implements Feedback { @Override public List<UserFeedback> getUserFeedback(UserInfo.Username username) { checkNotNull(username, "Parameter \"username\" cannot be null"); return feedbackRepository.getUserFeedback(username); } }
FeedbackImpl implements Feedback { @Override public List<UserFeedback> getUserFeedback(UserInfo.Username username) { checkNotNull(username, "Parameter \"username\" cannot be null"); return feedbackRepository.getUserFeedback(username); } @Inject  FeedbackImpl(final FeedbackRepository feedbackRepository, final UserDirectory userDirectory); }
FeedbackImpl implements Feedback { @Override public List<UserFeedback> getUserFeedback(UserInfo.Username username) { checkNotNull(username, "Parameter \"username\" cannot be null"); return feedbackRepository.getUserFeedback(username); } @Inject  FeedbackImpl(final FeedbackRepository feedbackRepository, final UserDirectory userDirectory); @Override void createUserFeedback(UserFeedback userFeedback); @Override List<UserFeedback> getUserFeedback(UserInfo.Username username); @Override List<UserFeedback> getAllUserFeedback(); }
FeedbackImpl implements Feedback { @Override public List<UserFeedback> getUserFeedback(UserInfo.Username username) { checkNotNull(username, "Parameter \"username\" cannot be null"); return feedbackRepository.getUserFeedback(username); } @Inject  FeedbackImpl(final FeedbackRepository feedbackRepository, final UserDirectory userDirectory); @Override void createUserFeedback(UserFeedback userFeedback); @Override List<UserFeedback> getUserFeedback(UserInfo.Username username); @Override List<UserFeedback> getAllUserFeedback();  }