R
- The return type.public class FluentThrowableAssertion<R> extends FluentAssertion<R>
Constructor and Description |
---|
FluentThrowableAssertion(Assertion creator,
Throwable value,
R returns)
Constructor.
|
FluentThrowableAssertion(Throwable value,
R returns)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
FluentThrowableAssertion<R> |
causedBy()
Returns an assertion against the caused-by throwable.
|
R |
contains(String... substrings)
Asserts that this throwable or any parent throwables contains all of the specified substrings.
|
R |
doesNotExist()
Asserts that this throwable doesn't exist.
|
R |
exists()
Asserts that this throwable exists.
|
FluentThrowableAssertion<R> |
find(Class<?> throwableClass)
Returns an assertion against the throwable localized message.
|
R |
is(String msg)
Asserts that this throwable has the specified message.
|
R |
isType(Class<?> type)
Asserts that this throwable is of the specified type.
|
FluentStringAssertion<R> |
localizedMessage()
Returns an assertion against the throwable localized message.
|
FluentStringAssertion<R> |
message()
Returns an assertion against the throwable message.
|
FluentThrowableAssertion<R> |
msg(String msg,
Object... args)
Allows to to specify the assertion failure message.
|
<T extends Throwable> |
passes(Class<T> c,
Predicate<T> test)
Asserts that the value passes the specified predicate test.
|
R |
passes(Predicate<Throwable> test)
Asserts that the value passes the specified predicate test.
|
FluentStringAssertion<R> |
stackTrace()
Returns an assertion against the throwable localized message.
|
FluentThrowableAssertion<R> |
stderr()
If an error occurs, send the error message to STDERR.
|
FluentThrowableAssertion<R> |
stdout()
If an error occurs, send the error message to STDOUT.
|
returns
assertNotNull, assertNotNull, className, error
public FluentThrowableAssertion(Throwable value, R returns)
value
- The throwable being tested.returns
- The object to return after the test.public FluentThrowableAssertion(Assertion creator, Throwable value, R returns)
creator
- The assertion that created this assertion.value
- The throwable being tested.returns
- The object to return after the test.public R isType(Class<?> type)
type
- The type.public R contains(String... substrings)
substrings
- The substrings to check for.public R is(String msg)
msg
- The message to check for.public R exists()
public R doesNotExist()
public R passes(Predicate<Throwable> test) throws AssertionError
test
- The predicate to use to test the value.AssertionError
- If assertion failed.public <T extends Throwable> R passes(Class<T> c, Predicate<T> test) throws AssertionError
T
- The class to cast to for the predicate.c
- The class to cast to for the predicate.test
- The predicate to use to test the value.AssertionError
- If assertion failed.public FluentStringAssertion<R> message()
public FluentStringAssertion<R> localizedMessage()
public FluentStringAssertion<R> stackTrace()
public FluentThrowableAssertion<R> causedBy()
public FluentThrowableAssertion<R> find(Class<?> throwableClass)
throwableClass
- The class type to search for in the caused-by chain.public FluentThrowableAssertion<R> msg(String msg, Object... args)
Assertion
String can contain
msg
in class FluentAssertion<R>
msg
- The assertion failure message.args
- Optional message arguments.public FluentThrowableAssertion<R> stderr()
Assertion
stderr
in class FluentAssertion<R>
public FluentThrowableAssertion<R> stdout()
Assertion
stdout
in class FluentAssertion<R>
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.