Package org.axonframework.test.fixture
Class Reporter
java.lang.Object
org.axonframework.test.fixture.Reporter
The reporter generates extensive human-readable reports of what the expected outcome of a test was, and what the
actual results were.
- Since:
- 0.6
- Author:
- Allard Buijze
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidreportDifferentMetadata(Class<?> messageType, Map<String, String> missingEntries, Map<String, String> additionalEntries) Report an error due to a difference in the metadata of a messagevoidreportDifferentPayloads(Class<?> messageType, Object actual, Object expected) Report an error due to a difference between the message payloads.voidreportDifferentPayloads(Class<?> messageType, Field field, Object actual, Object expected) Report an error due to a difference in one of the fields of the message payload.voidreportIncorrectDeletedState(boolean expectedDeletedState) Report an error due to a difference in the expected state of the `isDeleted` marker on the Aggregate.voidreportUnexpectedException(Throwable actualException, org.hamcrest.Description expectation) Reports an error due to an unexpected exception.voidreportUnexpectedReturnValue(Object actualReturnValue, org.hamcrest.Description description) Report an error due to an unexpected return value, while an exception was expected.voidreportWrongEvent(Collection<?> actualEvents, Collection<?> expectedEvents, Throwable probableCause) Report an error in the ordering or count of events.voidreportWrongEvent(Collection<?> actualEvents, org.hamcrest.Description expectation, org.hamcrest.Description mismatch, Throwable probableCause) Report an error of events not matching expectations defined byMatchers.voidreportWrongException(Throwable actualException, org.hamcrest.Description description) Report an error due to an exception of an unexpected type.voidreportWrongExceptionDetails(Object details, org.hamcrest.Description description) Report an error due to a difference in exception details.voidreportWrongExceptionMessage(Throwable actualException, org.hamcrest.Description description) Report an error due to a difference in exception message.voidreportWrongResult(Object actual, Object expectation) Reports an error due to a wrong return value.
-
Constructor Details
-
Reporter
public Reporter()
-
-
Method Details
-
reportWrongEvent
public void reportWrongEvent(Collection<?> actualEvents, Collection<?> expectedEvents, Throwable probableCause) Report an error in the ordering or count of events. This is typically a difference that can be shown to the user by enumerating the expected and actual events- Parameters:
actualEvents- The events that were foundexpectedEvents- The events that were expectedprobableCause- An optional exception that might be the reason for wrong events
-
reportWrongEvent
public void reportWrongEvent(Collection<?> actualEvents, org.hamcrest.Description expectation, org.hamcrest.Description mismatch, Throwable probableCause) Report an error of events not matching expectations defined byMatchers. This method will receive two differentDescriptions:expectation: textual description of the complete matcher (chain) that has been usedmismatch: detailed description of the mismatch.
- Parameters:
actualEvents- The events that were foundexpectation- A Description of what was expectedmismatch- detailed description of the actual mismatch.probableCause- An optional exception that might be the reason for wrong events
-
reportUnexpectedException
public void reportUnexpectedException(Throwable actualException, org.hamcrest.Description expectation) Reports an error due to an unexpected exception. This means a successful handling was expected, but an exception was thrown by the message handler- Parameters:
actualException- The actual exceptionexpectation- A text describing what was expected
-
reportWrongResult
Reports an error due to a wrong return value.- Parameters:
actual- The actual description / return valueexpectation- The expected description / return value
-
reportUnexpectedReturnValue
public void reportUnexpectedReturnValue(Object actualReturnValue, org.hamcrest.Description description) Report an error due to an unexpected return value, while an exception was expected.- Parameters:
actualReturnValue- The actual return valuedescription- A description describing the expected value
-
reportWrongException
Report an error due to an exception of an unexpected type.- Parameters:
actualException- The actual exceptiondescription- A description describing the expected value
-
reportWrongExceptionMessage
public void reportWrongExceptionMessage(Throwable actualException, org.hamcrest.Description description) Report an error due to a difference in exception message.- Parameters:
actualException- The actual exceptiondescription- A description describing the expected value
-
reportWrongExceptionDetails
Report an error due to a difference in exception details.- Parameters:
details- The actual detailsdescription- A description describing the expected value
-
reportDifferentPayloads
Report an error due to a difference between the message payloads.- Parameters:
messageType- The (runtime) type of the message the difference was found in.actual- The actual value of the payload.expected- The expected value of the payload.
-
reportDifferentPayloads
public void reportDifferentPayloads(Class<?> messageType, Field field, Object actual, Object expected) Report an error due to a difference in one of the fields of the message payload.- Parameters:
messageType- The (runtime) type of the message the difference was found in.field- The field that contains the difference.actual- The actual value of the field.expected- The expected value of the field.
-
reportDifferentMetadata
public void reportDifferentMetadata(Class<?> messageType, Map<String, String> missingEntries, Map<String, String> additionalEntries) Report an error due to a difference in the metadata of a message- Parameters:
messageType- The (runtime) type of the message the difference was found inmissingEntries- The expected key-value pairs that where not present in the metadataadditionalEntries- Key-value pairs that where present in the metadata but not expected
-
reportIncorrectDeletedState
public void reportIncorrectDeletedState(boolean expectedDeletedState) Report an error due to a difference in the expected state of the `isDeleted` marker on the Aggregate.- Parameters:
expectedDeletedState-trueif the Aggregate should have been marked as deleted, but was not.falseif the Aggregate should not have been marked as deleted, but was.
-