@Test public void testGetUserFeedbackEmptySuccess() { when(userFeedbackAccessor.getUserFeedback("userid1")).thenReturn(result); List<com.intuit.wasabi.repository.cassandra.pojo.UserFeedback> userFeedbacks = new ArrayList<>(); when(result.all()).thenReturn(userFeedbacks); List<UserFeedback> response = repository.getUserFeedback(Username.valueOf("userid1")); assertEquals("Size should be eq", 0, response.size()); }
@Override public List<UserFeedback> getUserFeedback(UserInfo.Username username) throws RepositoryException { LOGGER.debug("Getting user feedback for {}", username); Preconditions.checkNotNull(username, "Parameter \"username\" cannot be null"); List<UserFeedback> feedbacks = new ArrayList<>(); try { Result<com.intuit.wasabi.repository.cassandra.pojo.UserFeedback> result = userFeedbackAccessor.getUserFeedback(username.getUsername()); feedbacks = makeFeedbacksFromResult(result); } catch (Exception e) { LOGGER.error("Error while getting feedback for user " + username.getUsername(), e); throw new RepositoryException("Could not retrieve feedback from user " + username, e); } return feedbacks; }
CassandraFeedbackRepository implements FeedbackRepository { @Override public List<UserFeedback> getUserFeedback(UserInfo.Username username) throws RepositoryException { LOGGER.debug("Getting user feedback for {}", username); Preconditions.checkNotNull(username, "Parameter \"username\" cannot be null"); List<UserFeedback> feedbacks = new ArrayList<>(); try { Result<com.intuit.wasabi.repository.cassandra.pojo.UserFeedback> result = userFeedbackAccessor.getUserFeedback(username.getUsername()); feedbacks = makeFeedbacksFromResult(result); } catch (Exception e) { LOGGER.error("Error while getting feedback for user " + username.getUsername(), e); throw new RepositoryException("Could not retrieve feedback from user " + username, e); } return feedbacks; } }
CassandraFeedbackRepository implements FeedbackRepository { @Override public List<UserFeedback> getUserFeedback(UserInfo.Username username) throws RepositoryException { LOGGER.debug("Getting user feedback for {}", username); Preconditions.checkNotNull(username, "Parameter \"username\" cannot be null"); List<UserFeedback> feedbacks = new ArrayList<>(); try { Result<com.intuit.wasabi.repository.cassandra.pojo.UserFeedback> result = userFeedbackAccessor.getUserFeedback(username.getUsername()); feedbacks = makeFeedbacksFromResult(result); } catch (Exception e) { LOGGER.error("Error while getting feedback for user " + username.getUsername(), e); throw new RepositoryException("Could not retrieve feedback from user " + username, e); } return feedbacks; } @Inject  CassandraFeedbackRepository(UserFeedbackAccessor userFeedbackAccessor); }
CassandraFeedbackRepository implements FeedbackRepository { @Override public List<UserFeedback> getUserFeedback(UserInfo.Username username) throws RepositoryException { LOGGER.debug("Getting user feedback for {}", username); Preconditions.checkNotNull(username, "Parameter \"username\" cannot be null"); List<UserFeedback> feedbacks = new ArrayList<>(); try { Result<com.intuit.wasabi.repository.cassandra.pojo.UserFeedback> result = userFeedbackAccessor.getUserFeedback(username.getUsername()); feedbacks = makeFeedbacksFromResult(result); } catch (Exception e) { LOGGER.error("Error while getting feedback for user " + username.getUsername(), e); throw new RepositoryException("Could not retrieve feedback from user " + username, e); } return feedbacks; } @Inject  CassandraFeedbackRepository(UserFeedbackAccessor userFeedbackAccessor); @Override void createUserFeedback(UserFeedback userFeedback); @Override List<UserFeedback> getUserFeedback(UserInfo.Username username); @Override List<UserFeedback> getAllUserFeedback(); }
CassandraFeedbackRepository implements FeedbackRepository { @Override public List<UserFeedback> getUserFeedback(UserInfo.Username username) throws RepositoryException { LOGGER.debug("Getting user feedback for {}", username); Preconditions.checkNotNull(username, "Parameter \"username\" cannot be null"); List<UserFeedback> feedbacks = new ArrayList<>(); try { Result<com.intuit.wasabi.repository.cassandra.pojo.UserFeedback> result = userFeedbackAccessor.getUserFeedback(username.getUsername()); feedbacks = makeFeedbacksFromResult(result); } catch (Exception e) { LOGGER.error("Error while getting feedback for user " + username.getUsername(), e); throw new RepositoryException("Could not retrieve feedback from user " + username, e); } return feedbacks; } @Inject  CassandraFeedbackRepository(UserFeedbackAccessor userFeedbackAccessor); @Override void createUserFeedback(UserFeedback userFeedback); @Override List<UserFeedback> getUserFeedback(UserInfo.Username username); @Override List<UserFeedback> getAllUserFeedback();  }