Class Reporter

java.lang.Object
org.axonframework.test.fixture.Reporter

public class Reporter extends Object
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 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 found
      expectedEvents - The events that were expected
      probableCause - 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 by Matchers. This method will receive two different Descriptions:
      • expectation: textual description of the complete matcher (chain) that has been used
      • mismatch: detailed description of the mismatch.
      Parameters:
      actualEvents - The events that were found
      expectation - A Description of what was expected
      mismatch - 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 exception
      expectation - A text describing what was expected
    • reportWrongResult

      public void reportWrongResult(Object actual, Object expectation)
      Reports an error due to a wrong return value.
      Parameters:
      actual - The actual description / return value
      expectation - 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 value
      description - A description describing the expected value
    • reportWrongException

      public void reportWrongException(Throwable actualException, org.hamcrest.Description description)
      Report an error due to an exception of an unexpected type.
      Parameters:
      actualException - The actual exception
      description - 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 exception
      description - A description describing the expected value
    • reportWrongExceptionDetails

      public void reportWrongExceptionDetails(Object details, org.hamcrest.Description description)
      Report an error due to a difference in exception details.
      Parameters:
      details - The actual details
      description - A description describing the expected value
    • reportDifferentPayloads

      public void reportDifferentPayloads(Class<?> messageType, Object actual, Object expected)
      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 in
      missingEntries - The expected key-value pairs that where not present in the metadata
      additionalEntries - 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 - true if the Aggregate should have been marked as deleted, but was not. false if the Aggregate should not have been marked as deleted, but was.