Deprecated
as a consequence of AssertionErrorFactory being deprecated. See corresponding docs for further information.
AssertionError indicating that an assertion that verifies that two objects are equal
failed.
The built AssertionError's message differentiates actual and expected description if their
string representation are the same (e.g. 42 float and 42 double). It also mentions the comparator in case of a custom
comparator is used (instead of equals method).
| Modifier and Type | Field and Description |
|---|---|
| protected final Object | |
| protected final ComparisonStrategy | |
| pack-priv ConstructorInvoker | |
| pack-priv DescriptionFormatter | |
| protected final Object | |
| private static final String | |
| private static final String | |
| protected final MessageFormatter | |
| private static final Class | |
| private static final Class | |
| private Representation |
| Access | Constructor and Description |
|---|---|
| protected | ShouldBeEqual(Object actual, Object expected, ComparisonStrategy comparisonStrategy, Representation representation)
|
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | |
| private AssertionError | |
| private AssertionError | |
| protected String | Returns: the error message from description usingdetailedExpected() and detailedActual()
detailed representation.the description, Representation Description used to build the returned error messagethe representation)org. used to build String representation
of objectBuilds and returns an error message from description using |
| protected String | |
| protected String | |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. |
| private String | errorMessageForMultilineValues(Description description, Representation representation, String actualRepresentation, String expectedRepresentation)
|
| public int | |
| private boolean | |
| protected String | |
| private String | messageForMultilineValues(String actualRepresentation, String expectedRepresentation, Representation representation)
|
| public AssertionError | Returns: the createdAssertionError.the description of the failed assertion. description, Representation the representation)Representation used to format values.Implements org. indicating that an assertion that verifies that two objects are
equal failed.
|
| private AssertionError | |
| public static AssertionErrorFactory | Returns: the createdAssertionErrorFactory.the actual value in the failed assertion. actual, Object the expected value in the failed assertion. expected, Representation the representation)Representation used to format values.
Deprecated
as a consequence of
Creates a new AssertionErrorFactory being deprecated.
.
|
| public static AssertionErrorFactory | Returns: the createdAssertionErrorFactory.the actual value in the failed assertion. actual, Object the expected value in the failed assertion. expected, ComparisonStrategy the comparisonStrategy, Representation ComparisonStrategy used to compare actual with expected.the representation)Representation used to format values.
Deprecated
as a consequence of
Creates a new AssertionErrorFactory being deprecated.
.
|
| protected String | smartErrorMessage(Description
the description, Representation Description used to build the returned error messagethe representation)org. used to build String representation
of objectBuilds and returns an error message from the given description using |
| actual | back to summary |
|---|---|
| protected final Object actual | |
| comparisonStrategy | back to summary |
|---|---|
| protected final ComparisonStrategy comparisonStrategy | |
| constructorInvoker | back to summary |
|---|---|
| pack-priv ConstructorInvoker constructorInvoker
| |
| descriptionFormatter | back to summary |
|---|---|
| pack-priv DescriptionFormatter descriptionFormatter
| |
| expected | back to summary |
|---|---|
| protected final Object expected | |
| EXPECTED_BUT_WAS_MESSAGE | back to summary |
|---|---|
| private static final String EXPECTED_BUT_WAS_MESSAGE | |
| EXPECTED_BUT_WAS_MESSAGE_USING_COMPARATOR | back to summary |
|---|---|
| private static final String EXPECTED_BUT_WAS_MESSAGE_USING_COMPARATOR | |
| messageFormatter | back to summary |
|---|---|
| protected final MessageFormatter messageFormatter | |
| MSG_ARG_TYPES | back to summary |
|---|---|
| private static final Class<?>[] MSG_ARG_TYPES | |
| MSG_ARG_TYPES_FOR_ASSERTION_FAILED_ERROR | back to summary |
|---|---|
| private static final Class<?>[] MSG_ARG_TYPES_FOR_ASSERTION_FAILED_ERROR | |
| representation | back to summary |
|---|---|
| private Representation representation | |
| ShouldBeEqual | back to summary |
|---|---|
| protected ShouldBeEqual(Object actual, Object expected, ComparisonStrategy comparisonStrategy, Representation representation) | |
| actualAndExpectedHaveSameStringRepresentation | back to summary |
|---|---|
| protected boolean actualAndExpectedHaveSameStringRepresentation() | |
| assertionFailedError | back to summary |
|---|---|
| private AssertionError assertionFailedError(String message, Representation representation) | |
| comparisonFailure | back to summary |
|---|---|
| private AssertionError comparisonFailure(Description description) | |
| defaultDetailedErrorMessage | back to summary |
|---|---|
| protected String defaultDetailedErrorMessage(Description description, Representation representation) Builds and returns an error message from description using
| |
| detailedActual | back to summary |
|---|---|
| protected String detailedActual() | |
| detailedExpected | back to summary |
|---|---|
| protected String detailedExpected() | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| errorMessageForMultilineValues | back to summary |
|---|---|
| private String errorMessageForMultilineValues(Description description, Representation representation, String actualRepresentation, String expectedRepresentation) | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| hasMultilineValue | back to summary |
|---|---|
| private boolean hasMultilineValue(String actualRepresentation, String expectedRepresentation) | |
| indent | back to summary |
|---|---|
| protected String indent(String valueRepresentation) | |
| messageForMultilineValues | back to summary |
|---|---|
| private String messageForMultilineValues(String actualRepresentation, String expectedRepresentation, Representation representation) | |
| newAssertionError | back to summary |
|---|---|
| public AssertionError newAssertionError(Description description, Representation representation) Implements org. Creates an
If JUnit 4 is in the classpath and the description is standard (no comparator was used and
If opentest4j is on the classpath then AssertionError stack trace won't show AssertJ related elements if Failures is configured to filter
them (see Failures#setRemoveAssertJRelatedElementsFromStackTrace(boolean)).
| |
| newComparisonFailure | back to summary |
|---|---|
| private AssertionError newComparisonFailure(String description) throws Exception | |
| shouldBeEqual | back to summary |
|---|---|
| public static AssertionErrorFactory shouldBeEqual(Object actual, Object expected, Representation representation)
Deprecated as a consequence of Creates a new
| |
| shouldBeEqual | back to summary |
|---|---|
| public static AssertionErrorFactory shouldBeEqual(Object actual, Object expected, ComparisonStrategy comparisonStrategy, Representation representation)
Deprecated as a consequence of Creates a new
| |
| smartErrorMessage | back to summary |
|---|---|
| protected String smartErrorMessage(Description description, Representation representation) Builds and returns an error message from the given description using
| |