本文整理汇总了Java中org.assertj.core.api.AbstractThrowableAssert类的典型用法代码示例。如果您正苦于以下问题:Java AbstractThrowableAssert类的具体用法?Java AbstractThrowableAssert怎么用?Java AbstractThrowableAssert使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractThrowableAssert类属于org.assertj.core.api包,在下文中一共展示了AbstractThrowableAssert类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: assertThatThrownByWithExpectedException
import org.assertj.core.api.AbstractThrowableAssert; //导入依赖的package包/类
/**
* 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());
}
}
开发者ID:line,项目名称:centraldogma,代码行数:18,代码来源:ExpectedExceptionAppender.java
示例2: testException
import org.assertj.core.api.AbstractThrowableAssert; //导入依赖的package包/类
/** 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;
}
开发者ID:diffplug,项目名称:spotless,代码行数:13,代码来源:StepHarness.java
示例3: then
import org.assertj.core.api.AbstractThrowableAssert; //导入依赖的package包/类
/**
* 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);
}
开发者ID:theangrydev,项目名称:fluent-bdd,代码行数:8,代码来源:WithFluentAssertJ.java
示例4: and
import org.assertj.core.api.AbstractThrowableAssert; //导入依赖的package包/类
/**
* 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);
}
开发者ID:theangrydev,项目名称:fluent-bdd,代码行数:8,代码来源:WithFluentAssertJ.java
示例5: thenThrownBy
import org.assertj.core.api.AbstractThrowableAssert; //导入依赖的package包/类
/**
* 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);
}
开发者ID:theangrydev,项目名称:fluent-bdd,代码行数:8,代码来源:WithFluentAssertJ.java
示例6: andThrownBy
import org.assertj.core.api.AbstractThrowableAssert; //导入依赖的package包/类
/**
* 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);
}
开发者ID:theangrydev,项目名称:fluent-bdd,代码行数:8,代码来源:WithFluentAssertJ.java
示例7: assertThatThrownBy
import org.assertj.core.api.AbstractThrowableAssert; //导入依赖的package包/类
private AbstractThrowableAssert<?, ?> assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable) {
return org.assertj.core.api.Assertions.assertThatThrownBy(shouldRaiseThrowable)
.isInstanceOf(AssertionError.class);
}
开发者ID:OpenG,项目名称:aws-java-sdk,代码行数:5,代码来源:AssertionsTest.java
示例8: assertThat
import org.assertj.core.api.AbstractThrowableAssert; //导入依赖的package包/类
/**
* 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);
}
开发者ID:aro-tech,项目名称:extended-mockito,代码行数:8,代码来源:AssertJ.java
示例9: assertThatCode
import org.assertj.core.api.AbstractThrowableAssert; //导入依赖的package包/类
/**
* 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);
}
开发者ID:aro-tech,项目名称:extended-mockito,代码行数:8,代码来源:AssertJ.java
示例10: assertThatThrownBy
import org.assertj.core.api.AbstractThrowableAssert; //导入依赖的package包/类
/**
* 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);
}
开发者ID:aro-tech,项目名称:extended-mockito,代码行数:8,代码来源:AssertJ.java
注:本文中的org.assertj.core.api.AbstractThrowableAssert类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论