use of org.junit.experimental.categories.CategoryValidator in project junit4 by junit-team.
the class CategoryValidatorTest method testAndAssertErrorMessage.
private void testAndAssertErrorMessage(FrameworkMethod method, String expectedErrorMessage) {
List<Exception> errors = new CategoryValidator().validateAnnotatedMethod(method);
assertThat(errors.size(), is(1));
Exception exception = errors.get(0);
assertThat(exception.getMessage(), is(expectedErrorMessage));
}
use of org.junit.experimental.categories.CategoryValidator in project junit4 by junit-team.
the class CategoryValidatorTest method errorIsNotAddedWhenCategoryIsNotCombinedWithIllegalCombination.
@Test
public void errorIsNotAddedWhenCategoryIsNotCombinedWithIllegalCombination() throws NoSuchMethodException {
FrameworkMethod method = new FrameworkMethod(CategoryTest.class.getMethod("methodWithCategory"));
List<Exception> errors = new CategoryValidator().validateAnnotatedMethod(method);
assertThat(errors.size(), is(0));
}
Aggregations