Class ExpectedObjects
A collection of methods for building expected objects.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExpectedObject<Boolean>Returns an expected object where the object is expected to beBoolean.FALSEstatic <T> ExpectedObject<T>Returns an expected object where the object is expected to be null.static ExpectedObject<Boolean>Returns an expected object where the object is expected to beBoolean.TRUEstatic <T> ExpectedObject<T>equalTo(T object) Returns an expected object where the object is expected to be equal to the actual object.static <T,U extends T>
ExpectedObject<Class<? extends T>>instanceOf(Class<U> type, boolean subtypes) Returns an expected object where the object is expected be an instance of the given type.static <T> ExpectedObject<T>Returns an expected object where the object is not null.static <T> ExpectedObject<T>notEqualsTo(T object) Returns an expected object where the object is expected to be not equal to the given object.static <T> ExpectedObject<T>notSameAs(T object) Returns an expected object where the object is expected to be the same as the given object.static <T> ExpectedObject<T>sameAs(T object) Returns an expected object where the object is expected to be the same as the given object.static <T> ExpectedObject<T>Returns an expected where the actual result is not relevant.
-
Method Details
-
something
Returns an expected where the actual result is not relevant.
- Type Parameters:
T- the type of the expected object- Returns:
- the expected
-
equalTo
Returns an expected object where the object is expected to be equal to the actual object.
- Type Parameters:
T- the type of the expected object- Parameters:
object- the expected object- Returns:
- the expected behavior
-
equalsFalse
Returns an expected object where the object is expected to be
Boolean.FALSE- Returns:
- the expected behavior
-
equalsNull
Returns an expected object where the object is expected to be null.
- Returns:
- the expected behavior
-
equalsTrue
Returns an expected object where the object is expected to be
Boolean.TRUE- Returns:
- the expected behavior
-
instanceOf
public static <T,U extends T> ExpectedObject<Class<? extends T>> instanceOf(Class<U> type, boolean subtypes) Returns an expected object where the object is expected be an instance of the given type.
- Type Parameters:
T- the type of the expected object- Parameters:
type- the expected typesubtypes- if the actual object can be a subtype of the expected type- Returns:
- the expected behavior
-
notEqualsNull
Returns an expected object where the object is not null.
- Type Parameters:
T- the type of the expected object- Returns:
- the expected behavior
-
notEqualsTo
Returns an expected object where the object is expected to be not equal to the given object.
- Type Parameters:
T- the type of the unexpected object- Parameters:
object- the unexpected object- Returns:
- the expected behavior
-
notSameAs
Returns an expected object where the object is expected to be the same as the given object.
- Returns:
- the expected behavior
-
sameAs
Returns an expected object where the object is expected to be the same as the given object.
- Returns:
- the expected behavior
-