use of org.junit.platform.commons.util.PreconditionViolationException in project junit5 by junit-team.
the class TestTagTests method assertSyntaxViolation.
private void assertSyntaxViolation(String tag) {
PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, () -> TestTag.create(tag));
assertThat(exception).hasMessageStartingWith("Tag name");
assertThat(exception).hasMessageEndingWith("must be syntactically valid");
}
use of org.junit.platform.commons.util.PreconditionViolationException in project junit5 by junit-team.
the class TestInstanceLifecycleUtilsTests method getDefaultTestInstanceLifecyclePreconditions.
@Test
void getDefaultTestInstanceLifecyclePreconditions() {
PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, () -> getDefaultTestInstanceLifecycle(null));
assertThat(exception).hasMessage("ConfigurationParameters must not be null");
}
use of org.junit.platform.commons.util.PreconditionViolationException in project junit5 by junit-team.
the class AbstractTestRuleAdapterTests method constructionWithUnassignableArgumentsFails.
@Test
void constructionWithUnassignableArgumentsFails() {
PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, () -> new TestableTestRuleAdapter(new SimpleRuleAnnotatedMember(new TemporaryFolder()), Verifier.class));
assertEquals(exception.getMessage(), "class org.junit.rules.Verifier is not assignable from class org.junit.rules.TemporaryFolder");
}
Aggregations