public class ExceptionVerifier<T extends RuntimeException> extends Object implements org.junit.rules.TestRule
Consumer
Usage example :
Rule public ExceptionVerifier<HttpException> httpExceptionRule = new ExceptionVerifier<>();
@Test
public void test(){
httpExceptionRule.assertWith(e -> {
assertEquals(401, e.getResponse().status());
assertEquals("expected error message", e.getResponse().error(String.class));
});
}
Constructor and Description |
---|
ExceptionVerifier() |
Modifier and Type | Method and Description |
---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description) |
void |
assertWith(Consumer<T> consumer) |
public ExceptionVerifier()
public void assertWith(Consumer<T> consumer)
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
apply
in interface org.junit.rules.TestRule
1.1.6-SNAPSHOT - Copyright © 2018 Talend Component Kit Documentation