public abstract class VerifyAcknowledgements
extends java.lang.Object
Contains static factory methods for creating acknowledgement verifiers, checking that commands were acknowledged, responded with rejections, and errors.
Allows combining verifiers using and()
or factory
method shortcuts: ackedWithoutErrors().and(ackedWithRejection(rej))
can be simplified
to ackedWithoutErrors().withRejection(rej)
.
Constructor and Description |
---|
VerifyAcknowledgements() |
Modifier and Type | Method and Description |
---|---|
static VerifyAcknowledgements |
acked(Count expectedCount)
Verifies that Bounded Context responded with a specified number of acknowledgements.
|
static VerifyAcknowledgements |
ackedWithErrors()
Verifies that a command or an event was handled responding with some
error . |
static VerifyAcknowledgements |
ackedWithErrors(Count expected)
Verifies that a command or an event was handled responding with specified number of
errors . |
static VerifyAcknowledgements |
ackedWithErrors(ErrorCriterion criterion)
Verifies that a command or an event was handled responding with an error matching a provided
ErrorCriterion . |
static VerifyAcknowledgements |
ackedWithErrors(ErrorCriterion criterion,
Count expected)
Verifies that a command or an event was handled responding with an error matching a provided
error criterion . |
static VerifyAcknowledgements |
ackedWithoutErrors()
Verifies that the command handling did not respond with
error . |
static VerifyAcknowledgements |
ackedWithoutRejections()
Verifies that a command handling did not respond with any rejections.
|
static VerifyAcknowledgements |
ackedWithRejections()
Verifies that a command or an event was handled with a rejection.
|
static VerifyAcknowledgements |
ackedWithRejections(java.lang.Class<? extends io.spine.base.RejectionMessage> cls)
Verifies that a command or an event was handled responding with a rejection of the provided
type.
|
static VerifyAcknowledgements |
ackedWithRejections(java.lang.Class<? extends io.spine.base.RejectionMessage> cls,
Count expected)
Verifies that a command or an event was handled responding with a rejection of a provided
type specified number of times.
|
static <T extends io.spine.base.RejectionMessage> |
ackedWithRejections(java.lang.Class<T> type,
Count expected,
RejectionCriterion<T> criterion)
Verifies that a command or an event was handled responding with a provided domain rejection
specified number of times.
|
static <T extends io.spine.base.RejectionMessage> |
ackedWithRejections(java.lang.Class<T> type,
RejectionCriterion<T> predicate)
Verifies that a command or an event was handled responding with rejection matching the
provided predicate.
|
static VerifyAcknowledgements |
ackedWithRejections(Count expectedCount)
Verifies that a command or an event was handled responding with a rejection specified
number of times.
|
static VerifyAcknowledgements |
ackedWithRejections(io.spine.type.RejectionType type)
Verifies that a command or an event was handled responding with a rejection
of the provided type.
|
static VerifyAcknowledgements |
ackedWithRejections(io.spine.type.RejectionType type,
Count expected)
Verifies that a command or an event was handled responding with a rejection of a provided
type specified number of times.
|
VerifyAcknowledgements |
and(VerifyAcknowledgements otherVerifier)
Combines current verifier with a provided verifier, making them execute sequentially.
|
abstract void |
verify(Acknowledgements acks)
Executes the acknowledgement verifier throwing an assertion error if the
data does not match the rule..
|
VerifyAcknowledgements |
withErrors()
Creates a new verifier adding a check to contain at least one
error . |
VerifyAcknowledgements |
withErrors(Count expected)
Creates a new verifier adding a check to contain specified number of
errors.
|
VerifyAcknowledgements |
withErrors(ErrorCriterion criterion)
Creates a new verifier adding a check to contain an
error that matches
the criterion. |
VerifyAcknowledgements |
withErrors(ErrorCriterion criterion,
Count expected)
Creates a new verifier adding a check to contain an
error that matches
the criterion. |
VerifyAcknowledgements |
withoutErrors()
Creates a new verifier adding a check to not contain any
errors . |
VerifyAcknowledgements |
withoutErrorsOrRejections()
Creates a new verifier adding a check to not contain any
errors or rejections. |
VerifyAcknowledgements |
withoutRejections()
Creates a new verifier adding a check to not contain any rejections.
|
VerifyAcknowledgements |
withRejections()
Creates a new verifier adding a check to contain some rejection.
|
VerifyAcknowledgements |
withRejections(java.lang.Class<? extends io.spine.base.RejectionMessage> cls)
Creates a new verifier adding a check to contain a rejection of a
type specified by
class . |
VerifyAcknowledgements |
withRejections(java.lang.Class<? extends io.spine.base.RejectionMessage> cls,
Count expected)
Creates a new verifier adding a check to contain a rejection of the passed type
specified number of times.
|
<T extends io.spine.base.RejectionMessage> |
withRejections(java.lang.Class<T> type,
Count expected,
RejectionCriterion<T> predicate)
Creates a new verifier adding a check to contain a provided domain rejection.
|
<T extends io.spine.base.RejectionMessage> |
withRejections(java.lang.Class<T> type,
RejectionCriterion<T> predicate)
Creates a new verifier adding a check to contain a provided domain rejection.
|
VerifyAcknowledgements |
withRejections(io.spine.type.RejectionType type)
Creates a new verifier adding a check to contain a rejection of the specified type.
|
VerifyAcknowledgements |
withRejections(io.spine.type.RejectionType type,
Count expected)
Creates a new verifier adding a check to contain a rejection of the passed type
specified number of times.
|
public abstract void verify(Acknowledgements acks)
acks
- acknowledgements of handling commands by the Bounded Contextpublic static VerifyAcknowledgements acked(Count expectedCount)
public static VerifyAcknowledgements ackedWithoutErrors()
error
.public static VerifyAcknowledgements ackedWithErrors()
error
.public static VerifyAcknowledgements ackedWithErrors(Count expected)
errors
.public static VerifyAcknowledgements ackedWithErrors(ErrorCriterion criterion)
ErrorCriterion
.public static VerifyAcknowledgements ackedWithErrors(ErrorCriterion criterion, Count expected)
error criterion
.public static VerifyAcknowledgements ackedWithoutRejections()
public static VerifyAcknowledgements ackedWithRejections()
public static VerifyAcknowledgements ackedWithRejections(java.lang.Class<? extends io.spine.base.RejectionMessage> cls)
cls
- rejection type in a form of message classpublic static VerifyAcknowledgements ackedWithRejections(io.spine.type.RejectionType type)
public static <T extends io.spine.base.RejectionMessage> VerifyAcknowledgements ackedWithRejections(java.lang.Class<T> type, RejectionCriterion<T> predicate)
T
- a domain rejection typetype
- a type of a domain rejection specified by a message classpredicate
- a predicate filtering the domain rejectionspublic static VerifyAcknowledgements ackedWithRejections(Count expectedCount)
public static VerifyAcknowledgements ackedWithRejections(java.lang.Class<? extends io.spine.base.RejectionMessage> cls, Count expected)
public static VerifyAcknowledgements ackedWithRejections(io.spine.type.RejectionType type, Count expected)
public static <T extends io.spine.base.RejectionMessage> VerifyAcknowledgements ackedWithRejections(java.lang.Class<T> type, Count expected, RejectionCriterion<T> criterion)
T
- a domain rejection typetype
- a type of a domain rejection specified by a message classexpected
- a number of rejection that are expected in Bounded Contextcriterion
- a criterion filtering domain rejectionspublic VerifyAcknowledgements and(VerifyAcknowledgements otherVerifier)
otherVerifier
- a verifier executed after the current verifierpublic VerifyAcknowledgements withoutErrors()
errors
.public VerifyAcknowledgements withErrors()
error
.public VerifyAcknowledgements withErrors(Count expected)
public VerifyAcknowledgements withErrors(ErrorCriterion criterion)
error
that matches
the criterion.criterion
- an error criterion specifying which kind of error should be a part of acknowledgementpublic VerifyAcknowledgements withErrors(ErrorCriterion criterion, Count expected)
error
that matches
the criterion.criterion
- an error criterion specifying which kind of error should be a part of acknowledgementexpected
- a number of errors that are expected to match the criterionpublic VerifyAcknowledgements withoutErrorsOrRejections()
errors
or rejections.public VerifyAcknowledgements withoutRejections()
public VerifyAcknowledgements withRejections()
public VerifyAcknowledgements withRejections(java.lang.Class<? extends io.spine.base.RejectionMessage> cls)
class
.public VerifyAcknowledgements withRejections(io.spine.type.RejectionType type)
public VerifyAcknowledgements withRejections(java.lang.Class<? extends io.spine.base.RejectionMessage> cls, Count expected)
public VerifyAcknowledgements withRejections(io.spine.type.RejectionType type, Count expected)
public <T extends io.spine.base.RejectionMessage> VerifyAcknowledgements withRejections(java.lang.Class<T> type, RejectionCriterion<T> predicate)
public <T extends io.spine.base.RejectionMessage> VerifyAcknowledgements withRejections(java.lang.Class<T> type, Count expected, RejectionCriterion<T> predicate)
T
- a domain rejection typetype
- a class of the domain rejectionsexpected
- a number of rejection that are expected in Bounded Contextpredicate
- a predicate filtering domain rejections