@Test(expected = RepositoryException.class) public void testGetAllUserFeedbackThrowsException() { doThrow(new RuntimeException("testException")).when(userFeedbackAccessor).getAllUserFeedback(); List<UserFeedback> response = repository.getAllUserFeedback(); }
@Override public List<UserFeedback> getAllUserFeedback() { LOGGER.debug("Getting all user feedbacks "); List<UserFeedback> feedbacks = new ArrayList<>(); try { Result<com.intuit.wasabi.repository.cassandra.pojo.UserFeedback> result = userFeedbackAccessor.getAllUserFeedback(); feedbacks = makeFeedbacksFromResult(result); } catch (Exception e) { LOGGER.error("Error while getting all user feedback", e); throw new RepositoryException("Could not retrieve feedback from all users", e); } return feedbacks; }
CassandraFeedbackRepository implements FeedbackRepository { @Override public List<UserFeedback> getAllUserFeedback() { LOGGER.debug("Getting all user feedbacks "); List<UserFeedback> feedbacks = new ArrayList<>(); try { Result<com.intuit.wasabi.repository.cassandra.pojo.UserFeedback> result = userFeedbackAccessor.getAllUserFeedback(); feedbacks = makeFeedbacksFromResult(result); } catch (Exception e) { LOGGER.error("Error while getting all user feedback", e); throw new RepositoryException("Could not retrieve feedback from all users", e); } return feedbacks; } }
CassandraFeedbackRepository implements FeedbackRepository { @Override public List<UserFeedback> getAllUserFeedback() { LOGGER.debug("Getting all user feedbacks "); List<UserFeedback> feedbacks = new ArrayList<>(); try { Result<com.intuit.wasabi.repository.cassandra.pojo.UserFeedback> result = userFeedbackAccessor.getAllUserFeedback(); feedbacks = makeFeedbacksFromResult(result); } catch (Exception e) { LOGGER.error("Error while getting all user feedback", e); throw new RepositoryException("Could not retrieve feedback from all users", e); } return feedbacks; } @Inject  CassandraFeedbackRepository(UserFeedbackAccessor userFeedbackAccessor); }
CassandraFeedbackRepository implements FeedbackRepository { @Override public List<UserFeedback> getAllUserFeedback() { LOGGER.debug("Getting all user feedbacks "); List<UserFeedback> feedbacks = new ArrayList<>(); try { Result<com.intuit.wasabi.repository.cassandra.pojo.UserFeedback> result = userFeedbackAccessor.getAllUserFeedback(); feedbacks = makeFeedbacksFromResult(result); } catch (Exception e) { LOGGER.error("Error while getting all user feedback", e); throw new RepositoryException("Could not retrieve feedback from all users", 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> getAllUserFeedback() { LOGGER.debug("Getting all user feedbacks "); List<UserFeedback> feedbacks = new ArrayList<>(); try { Result<com.intuit.wasabi.repository.cassandra.pojo.UserFeedback> result = userFeedbackAccessor.getAllUserFeedback(); feedbacks = makeFeedbacksFromResult(result); } catch (Exception e) { LOGGER.error("Error while getting all user feedback", e); throw new RepositoryException("Could not retrieve feedback from all users", e); } return feedbacks; } @Inject  CassandraFeedbackRepository(UserFeedbackAccessor userFeedbackAccessor); @Override void createUserFeedback(UserFeedback userFeedback); @Override List<UserFeedback> getUserFeedback(UserInfo.Username username); @Override List<UserFeedback> getAllUserFeedback();  }