Ejemplo n.º 1
0
 private void validateTopicHasQuestions(CreateQuestion createQuestion, Errors errors) {
   int count =
       this.questionService.getNumberOfQuestionsInTheTopic(createQuestion.getTopic(), errors);
   if (count == 0)
     errors.rejectValue(
         "", "invalid.answers", "topic has no answers. select a topic that has one");
 }