Package io.simplesource.kafka.testutils
Class AggregateTestHelper.PublishBuilder
- java.lang.Object
-
- io.simplesource.kafka.testutils.AggregateTestHelper.PublishBuilder
-
-
Method Summary
Modifier and Type Method Description AggregateTestHelper.PublishResponseexpecting(io.simplesource.data.NonEmptyList<E> expectedEvents, A expectedAggregate)Publish the command and assert that the publishCommand was success generating the given events and aggregate_update update.voidexpectingFailure(io.simplesource.data.NonEmptyList<io.simplesource.api.CommandError.Reason> expectedErrorCodes)Publish the command and assert that the call failed.voidexpectingFailure(java.util.function.Consumer<io.simplesource.data.NonEmptyList<io.simplesource.api.CommandError>> failureValidator)Publish the command and assert that the call failed.
-
-
-
Method Detail
-
expecting
public AggregateTestHelper.PublishResponse expecting(io.simplesource.data.NonEmptyList<E> expectedEvents, A expectedAggregate)
Publish the command and assert that the publishCommand was success generating the given events and aggregate_update update.- Parameters:
expectedAggregate- the list of expected eventsexpectedAggregate- the expected aggregate state
-
expectingFailure
public void expectingFailure(java.util.function.Consumer<io.simplesource.data.NonEmptyList<io.simplesource.api.CommandError>> failureValidator)
Publish the command and assert that the call failed.- Parameters:
failureValidator- the failure reasons are provided for validation
-
expectingFailure
public void expectingFailure(io.simplesource.data.NonEmptyList<io.simplesource.api.CommandError.Reason> expectedErrorCodes)
Publish the command and assert that the call failed.- Parameters:
expectedErrorCodes- expected error codes contains in each of the generated failure reasons
-
-