You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi to all, I use maven plugin Cobertura 2.7. I want to test the below method.
protected void validateCategoryAndAssociatedQuestionType(CategoryQuestionDto dto, Category cat, Question que) {
if (!((cat instanceof TriviaCategory && que instanceof TriviaQuestion) || (cat instanceof TestCategory && que instanceof TestQuestion) || (cat instanceof GuessingGameCategory && que instanceof GuessingGameQuestion)))
{
throw new QuestionAndCategoryNotOfTheSameTypeException("Question with id: " + dto.getId().getQuestionId() + " and Category with id: " + dto.getId().getCategoryId() + " are not of the same type");
}
}
and I am testing this with the below test.
@Test(expected = QuestionAndCategoryNotOfTheSameTypeException.class)
public void validateCategoryAndAssociatedQuestionTypeFailure6(){
GuessingGameCategory category = new GuessingGameCategory();
TestQuestion question = new TestQuestion();
question.setId(1);
category.setId(1);
CategoryQuestion pair = new CategoryQuestion(category, question, (short)1);
service.validateCategoryAndAssociatedQuestionType(new CategoryQuestionDto().fromEntity(pair), category, question);
}
```
Can someone tell me why this method in coverage report is with red lines?
The text was updated successfully, but these errors were encountered:
Hi to all, I use maven plugin Cobertura 2.7. I want to test the below method.
and I am testing this with the below test.
The text was updated successfully, but these errors were encountered: