@Test public void serverManagerIsNotCalledWhenListIsNull() { submitter.submitFeedback(null, ""); verify(server, times(0)).submitFeedback(Mockito.anyString(), Mockito.anyListOf(FeedbackAnswer.class)); }
public void submitFeedback(List<FeedbackAnswer> answers, String answerUrl) { if (answers == null || answers.isEmpty() || answerUrl == null || answerUrl.trim().length() == 0) { return; } if (answersAreEmpty(answers)) { return; } server.submitFeedback(answerUrl, answers); }
FeedbackAnswerSubmitter { public void submitFeedback(List<FeedbackAnswer> answers, String answerUrl) { if (answers == null || answers.isEmpty() || answerUrl == null || answerUrl.trim().length() == 0) { return; } if (answersAreEmpty(answers)) { return; } server.submitFeedback(answerUrl, answers); } }
FeedbackAnswerSubmitter { public void submitFeedback(List<FeedbackAnswer> answers, String answerUrl) { if (answers == null || answers.isEmpty() || answerUrl == null || answerUrl.trim().length() == 0) { return; } if (answersAreEmpty(answers)) { return; } server.submitFeedback(answerUrl, answers); } FeedbackAnswerSubmitter(ServerManager server); }
FeedbackAnswerSubmitter { public void submitFeedback(List<FeedbackAnswer> answers, String answerUrl) { if (answers == null || answers.isEmpty() || answerUrl == null || answerUrl.trim().length() == 0) { return; } if (answersAreEmpty(answers)) { return; } server.submitFeedback(answerUrl, answers); } FeedbackAnswerSubmitter(ServerManager server); void submitFeedback(List<FeedbackAnswer> answers, String answerUrl); }
FeedbackAnswerSubmitter { public void submitFeedback(List<FeedbackAnswer> answers, String answerUrl) { if (answers == null || answers.isEmpty() || answerUrl == null || answerUrl.trim().length() == 0) { return; } if (answersAreEmpty(answers)) { return; } server.submitFeedback(answerUrl, answers); } FeedbackAnswerSubmitter(ServerManager server); void submitFeedback(List<FeedbackAnswer> answers, String answerUrl);  }