public class Assertions extends Object
Constructor and Description |
---|
Assertions() |
Modifier and Type | Method and Description |
---|---|
static ArrayAssertion |
assertArray(Object value)
Used for assertion calls against arrays.
|
static BooleanAssertion |
assertBoolean(Boolean value)
Used for assertion calls against boolean objects.
|
static ByteArrayAssertion |
assertBytes(byte[] bytes)
Used for assertion calls against byte arrays.
|
static CollectionAssertion |
assertCollection(Collection<?> value)
Used for assertion calls against
Collection objects. |
static ComparableAssertion |
assertComparable(Comparable<?> value)
Used for assertion calls against longs.
|
static DateAssertion |
assertDate(Date value)
Used for assertion calls against
Date objects. |
static IntegerAssertion |
assertInteger(Integer value)
Used for assertion calls against integers.
|
static ListAssertion |
assertList(List<?> value)
Used for assertion calls against
Collection objects. |
static LongAssertion |
assertLong(Long value)
Used for assertion calls against longs.
|
static ObjectAssertion |
assertObject(Object value)
Used for assertion calls against arbitrary POJOs.
|
static StringAssertion |
assertReader(Reader r)
Used for assertion calls against the contents of readers.
|
static ByteArrayAssertion |
assertStream(InputStream is)
Used for assertion calls against the contents of input streams.
|
static StringAssertion |
assertString(Object value)
Used for assertion calls against string objects.
|
static ThrowableAssertion |
assertThrowable(Throwable value)
Used for assertion calls against throwable objects.
|
static ThrowableAssertion |
assertThrown(Snippet snippet)
Executes an arbitrary snippet of code and captures anything thrown from it.
|
static ZonedDateTimeAssertion |
assertZonedDateTimeAssertion(ZonedDateTime value)
Used for assertion calls against
ZonedDateTime objects. |
public Assertions()
public static DateAssertion assertDate(Date value)
Date
objects.
value
- The date being wrapped.DateAssertion
object. Never public static ZonedDateTimeAssertion assertZonedDateTimeAssertion(ZonedDateTime value)
ZonedDateTime
objects.
value
- The date being wrapped.ZonedDateTimeAssertion
object. Never public static IntegerAssertion assertInteger(Integer value)
value
- The object being wrapped.IntegerAssertion
object. Never public static LongAssertion assertLong(Long value)
value
- The object being wrapped.LongAssertion
object. Never public static ComparableAssertion assertComparable(Comparable<?> value)
value
- The object being wrapped.LongAssertion
object. Never public static ObjectAssertion assertObject(Object value)
value
- The object being wrapped.ObjectAssertion
object. Never public static StringAssertion assertString(Object value)
value
- The string being wrapped.StringAssertion
object. Never public static BooleanAssertion assertBoolean(Boolean value)
value
- The boolean being wrapped.BooleanAssertion
object. Never public static ThrowableAssertion assertThrowable(Throwable value)
value
- The throwable being wrapped.ThrowableAssertion
object. Never public static ArrayAssertion assertArray(Object value)
String[]
value
- The object being wrapped.ArrayAssertion
object. Never public static CollectionAssertion assertCollection(Collection<?> value)
Collection
objects.
List=<String>
value
- The object being wrapped.CollectionAssertion
object. Never public static ListAssertion assertList(List<?> value)
Collection
objects.
List=<String>
value
- The object being wrapped.ListAssertion
object. Never public static ThrowableAssertion assertThrown(Snippet snippet)
snippet
- The snippet of code to execute.public static ByteArrayAssertion assertStream(InputStream is) throws IOException
is
- The input stream being wrapped.ByteArrayAssertion
object. Never IOException
- If thrown while reading contents from stream.public static ByteArrayAssertion assertBytes(byte[] bytes)
bytes
- The byte array being wrapped.ByteArrayAssertion
object. Never public static StringAssertion assertReader(Reader r) throws IOException
r
- The reader being wrapped.StringAssertion
object. Never IOException
- If thrown while reading contents from reader.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.