Class AggregateTestHelper.PublishBuilder

    • Method Summary

      Modifier and Type Method Description
      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.
      void expectingFailure​(io.simplesource.data.NonEmptyList<io.simplesource.api.CommandError.Reason> expectedErrorCodes)
      Publish the command and assert that the call failed.
      void expectingFailure​(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 events
        expectedAggregate - 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