Package org.assertj.core.error
Class ShouldBeInstance
java.lang.Object
org.assertj.core.error.BasicErrorMessageFactory
org.assertj.core.error.ShouldBeInstance
- All Implemented Interfaces:
ErrorMessageFactory
Creates an error message indicating that an assertion that verifies that an object is an instance of some type
failed.
- Author:
- Alex Ruiz, Joel Costigliola
-
Field Summary
Fields inherited from class org.assertj.core.error.BasicErrorMessageFactory
arguments, format -
Method Summary
Modifier and TypeMethodDescriptionstatic ErrorMessageFactoryshouldBeInstance(Object object, Class<?> type) Creates a new.ShouldBeInstancestatic ErrorMessageFactoryshouldBeInstanceButWasNull(String objectDescription, Class<?> type) Creates a newwhen object we want to check type is null.ShouldBeInstanceMethods inherited from class org.assertj.core.error.BasicErrorMessageFactory
create, create, create, equals, hashCode, toString, unquotedString
-
Method Details
-
shouldBeInstance
Creates a new.ShouldBeInstance- Parameters:
object- the object value in the failed assertion.type- the typeobjectis \nExpecting:\n to belong to.- Returns:
- the created
ErrorMessageFactory.
-
shouldBeInstanceButWasNull
public static ErrorMessageFactory shouldBeInstanceButWasNull(String objectDescription, Class<?> type) Creates a newwhen object we want to check type is null.ShouldBeInstance- Parameters:
objectDescription- the description of the null object we wanted to check type.type- the \nExpecting:\n type.- Returns:
- the created
ErrorMessageFactory.
-