|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ResultValidator
Interface describing the operations available on the "validate result" (a.k.a. "then") stage of the test execution.
The underlying fixture expects a test to have been executed succesfully using a TestExecutor.
void return value, or
| Method Summary | |
|---|---|
ResultValidator |
expectEvents(DomainEvent... expectedEvents)
Expect the given set of events to have been stored and published. |
ResultValidator |
expectException(Class<? extends Throwable> expectedException)
Expect the given expectedException to occur during command handler execution. |
ResultValidator |
expectPublishedEvents(Event... expectedEvents)
Expect the given set of events to have been published on the events bus. |
ResultValidator |
expectReturnValue(Object expectedReturnValue)
Expect the command handler to return the given expectedReturnValue after execution. |
ResultValidator |
expectStoredEvents(DomainEvent... expectedEvents)
Expect the given set of events to have been stored in the event store. |
ResultValidator |
expectVoidReturnType()
Explicitly expect a void return type on the given command handler. |
| Method Detail |
|---|
ResultValidator expectEvents(DomainEvent... expectedEvents)
expectPublishedEvents(org.axonframework.domain.Event...) and expectStoredEvents(org.axonframework.domain.DomainEvent...) methods instead.
All events are compared for equality using a shallow equals comparison on all the fields of the events. This
means that all assigned values on the events' fields should have a proper equals implementation.
Note that the event identifier is ignored in the comparison.
expectedEvents - The expected events, in the exact order they are expected to be dispatched and stored.
ResultValidator expectPublishedEvents(Event... expectedEvents)
expectEvents(org.axonframework.domain.DomainEvent...) instead.
All events are compared for equality using a shallow equals comparison on all the fields of the events. This
means that all assigned values on the events' fields should have a proper equals implementation.
Note that the event identifier is ignored in the comparison. For Application and System events, however, the
source of the events must be equal, too.
expectedEvents - The expected events, in the exact order they are expected to be dispatched.
ResultValidator expectStoredEvents(DomainEvent... expectedEvents)
expectEvents(org.axonframework.domain.DomainEvent...) instead.
All events are compared for equality using a shallow equals comparison on all the fields of the events. This
means that all assigned values on the events' fields should have a proper equals implementation.
Note that the event identifier is ignored in the comparison. For Application and System events, however, the
source of the events must be equal, too.
expectedEvents - The expected events, in the exact order they are expected to be stored.
ResultValidator expectReturnValue(Object expectedReturnValue)
expectedReturnValue after execution. The actual and
expected values are compared using their equals methods.
expectedReturnValue - The expected return value of the command execution
ResultValidator expectException(Class<? extends Throwable> expectedException)
expectedException to occur during command handler execution. The actual exception
should be exactly of that type, subclasses are not accepted.
expectedException - The type of exception expected from the command handler execution
ResultValidator expectVoidReturnType()
void return type on the given command handler. void is the
recommended return value for all command handlers as they allow for a more scalable architecture.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||