Java 类org.assertj.core.api.AbstractThrowableAssert 实例源码

项目:centraldogma    文件:ExpectedExceptionAppender.java   
/**
 * Adds {@code "(expected exception)"} to the log message and lower its logging level to
 * {@link Level#DEBUG} if the exception occurred from the {@code shouldRaiseThrowable} matches
 * {@code throwable} and contains {@code message}.
 */
public static AbstractThrowableAssert<?, ? extends Throwable> assertThatThrownByWithExpectedException(
        Class<?> throwable, String message, ThrowingCallable shouldRaiseThrowable) throws Exception {
    requireNonNull(throwable, "throwable");
    requireNonNull(message, "message");
    requireNonNull(shouldRaiseThrowable, "shouldRaiseThrowable");
    exceptionAndMessage.put(throwable.getName(), message);
    try {
        return assertThatThrownBy(shouldRaiseThrowable);
    } finally {
        exceptionAndMessage.remove(throwable.getName());
    }
}
项目:spotless    文件:StepHarness.java   
/** Asserts that the given elements in the resources directory are transformed as expected. */
public StepHarness testException(String resourceBefore, Consumer<AbstractThrowableAssert<?, ? extends Throwable>> exceptionAssertion) throws Exception {
    String before = ResourceHarness.getTestResource(resourceBefore);
    try {
        formatter.apply(before);
        Assert.fail();
    } catch (Throwable t) {
        AbstractThrowableAssert<?, ? extends Throwable> abstractAssert = Assertions.assertThat(t);
        exceptionAssertion.accept(abstractAssert);
    }
    return this;
}
项目:fluent-bdd    文件:WithFluentAssertJ.java   
/**
 * Delegate call to {@link org.assertj.core.api.Assertions#assertThat(Throwable)}
 */
default AbstractThrowableAssert<?, ? extends Throwable> then(Throwable actual) {
    fluentBdd().verification.recordThen(this);
    return DELEGATE.assertThat(actual);
}
项目:fluent-bdd    文件:WithFluentAssertJ.java   
/**
 * Delegate call to {@link org.assertj.core.api.Assertions#assertThat(Throwable)}
 */
default AbstractThrowableAssert<?, ? extends Throwable> and(Throwable actual) {
    fluentBdd().verification.recordThen(this);
    return DELEGATE.assertThat(actual);
}
项目:fluent-bdd    文件:WithFluentAssertJ.java   
/**
 * Delegate call to {@link org.assertj.core.api.Assertions#assertThatThrownBy(ThrowingCallable)}
 */
default AbstractThrowableAssert<?, ? extends Throwable> thenThrownBy(ThrowingCallable shouldRaiseThrowable) {
    fluentBdd().verification.recordThen(this);
    return DELEGATE.assertThatThrownBy(shouldRaiseThrowable);
}
项目:fluent-bdd    文件:WithFluentAssertJ.java   
/**
 * Delegate call to {@link org.assertj.core.api.Assertions#assertThatThrownBy(ThrowingCallable)}
 */
default AbstractThrowableAssert<?, ? extends Throwable> andThrownBy(ThrowingCallable shouldRaiseThrowable) {
    fluentBdd().verification.recordThen(this);
    return DELEGATE.assertThatThrownBy(shouldRaiseThrowable);
}
项目:aws-java-sdk    文件:AssertionsTest.java   
private AbstractThrowableAssert<?, ?> assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable) {
    return org.assertj.core.api.Assertions.assertThatThrownBy(shouldRaiseThrowable)
            .isInstanceOf(AssertionError.class);
}
项目:extended-mockito    文件:AssertJ.java   
/**
 * Delegate call to public static org.assertj.core.api.AbstractThrowableAssert<?, ? extends java.lang.Throwable> org.assertj.core.api.Assertions.assertThat(java.lang.Throwable)
 * {@link org.assertj.core.api.Assertions#assertThat(java.lang.Throwable)}
 */
default AbstractThrowableAssert<?, ? extends Throwable> assertThat(Throwable actual) {
    return Assertions.assertThat(actual);
}
项目:extended-mockito    文件:AssertJ.java   
/**
 * Delegate call to public static org.assertj.core.api.AbstractThrowableAssert<?, ? extends java.lang.Throwable> org.assertj.core.api.Assertions.assertThatCode(org.assertj.core.api.ThrowableAssert$ThrowingCallable)
 * {@link org.assertj.core.api.Assertions#assertThatCode(org.assertj.core.api.ThrowableAssert$ThrowingCallable)}
 */
default AbstractThrowableAssert<?, ? extends Throwable> assertThatCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable) {
    return Assertions.assertThatCode(shouldRaiseOrNotThrowable);
}
项目:extended-mockito    文件:AssertJ.java   
/**
 * Delegate call to public static org.assertj.core.api.AbstractThrowableAssert<?, ? extends java.lang.Throwable> org.assertj.core.api.Assertions.assertThatThrownBy(org.assertj.core.api.ThrowableAssert$ThrowingCallable)
 * {@link org.assertj.core.api.Assertions#assertThatThrownBy(org.assertj.core.api.ThrowableAssert$ThrowingCallable)}
 */
default AbstractThrowableAssert<?, ? extends Throwable> assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable) {
    return Assertions.assertThatThrownBy(shouldRaiseThrowable);
}
项目:extended-mockito    文件:AssertJ.java   
/**
 * Delegate call to public static org.assertj.core.api.AbstractThrowableAssert<?, ? extends java.lang.Throwable> org.assertj.core.api.Assertions.assertThatThrownBy(org.assertj.core.api.ThrowableAssert$ThrowingCallable,java.lang.String,java.lang.Object...)
 * {@link org.assertj.core.api.Assertions#assertThatThrownBy(org.assertj.core.api.ThrowableAssert$ThrowingCallable,java.lang.String,java.lang.Object[])}
 */
default AbstractThrowableAssert<?, ? extends Throwable> assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable, String description, Object... args) {
    return Assertions.assertThatThrownBy(shouldRaiseThrowable, description, args);
}
项目:tdd-mixins-core    文件:AssertJ.java   
/**
 * Delegate call to public static org.assertj.core.api.AbstractThrowableAssert<?, ? extends java.lang.Throwable> org.assertj.core.api.Assertions.assertThat(java.lang.Throwable)
 * {@link org.assertj.core.api.Assertions#assertThat(java.lang.Throwable)}
 */
default AbstractThrowableAssert<?, ? extends Throwable> assertThat(Throwable actual) {
    return Assertions.assertThat(actual);
}
项目:tdd-mixins-core    文件:AssertJ.java   
/**
 * Delegate call to public static org.assertj.core.api.AbstractThrowableAssert<?, ? extends java.lang.Throwable> org.assertj.core.api.Assertions.assertThatCode(org.assertj.core.api.ThrowableAssert$ThrowingCallable)
 * {@link org.assertj.core.api.Assertions#assertThatCode(org.assertj.core.api.ThrowableAssert$ThrowingCallable)}
 */
default AbstractThrowableAssert<?, ? extends Throwable> assertThatCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable) {
    return Assertions.assertThatCode(shouldRaiseOrNotThrowable);
}
项目:tdd-mixins-core    文件:AssertJ.java   
/**
 * Delegate call to public static org.assertj.core.api.AbstractThrowableAssert<?, ? extends java.lang.Throwable> org.assertj.core.api.Assertions.assertThatThrownBy(org.assertj.core.api.ThrowableAssert$ThrowingCallable)
 * {@link org.assertj.core.api.Assertions#assertThatThrownBy(org.assertj.core.api.ThrowableAssert$ThrowingCallable)}
 */
default AbstractThrowableAssert<?, ? extends Throwable> assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable) {
    return Assertions.assertThatThrownBy(shouldRaiseThrowable);
}
项目:tdd-mixins-core    文件:AssertJ.java   
/**
 * Delegate call to public static org.assertj.core.api.AbstractThrowableAssert<?, ? extends java.lang.Throwable> org.assertj.core.api.Assertions.assertThatThrownBy(org.assertj.core.api.ThrowableAssert$ThrowingCallable,java.lang.String,java.lang.Object...)
 * {@link org.assertj.core.api.Assertions#assertThatThrownBy(org.assertj.core.api.ThrowableAssert$ThrowingCallable,java.lang.String,java.lang.Object[])}
 */
default AbstractThrowableAssert<?, ? extends Throwable> assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable, String description, Object... args) {
    return Assertions.assertThatThrownBy(shouldRaiseThrowable, description, args);
}
项目:interface-it    文件:AssertJ.java   
/**
 * Delegate call to public static org.assertj.core.api.AbstractThrowableAssert<?, ? extends java.lang.Throwable> org.assertj.core.api.Assertions.assertThat(java.lang.Throwable)
 * {@link org.assertj.core.api.Assertions#assertThat(java.lang.Throwable)}
 */
default AbstractThrowableAssert<?, ? extends Throwable> assertThat(Throwable actual) {
    return Assertions.assertThat(actual);
}
项目:interface-it    文件:AssertJ.java   
/**
 * Delegate call to public static org.assertj.core.api.AbstractThrowableAssert<?, ? extends java.lang.Throwable> org.assertj.core.api.Assertions.assertThatThrownBy(org.assertj.core.api.ThrowableAssert$ThrowingCallable)
 * {@link org.assertj.core.api.Assertions#assertThatThrownBy(org.assertj.core.api.ThrowableAssert$ThrowingCallable)}
 */
default AbstractThrowableAssert<?, ? extends Throwable> assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable) {
    return Assertions.assertThatThrownBy(shouldRaiseThrowable);
}