Record Class AxonTestFixture.Customization
- Record Components:
axonServerEnabled- True if Axon Server should be enabled, false otherwise. It's enabled by default.fieldFilters- Collections ofFieldFiltersused to adjust the matchers for commands, events, and result messages.
- Enclosing class:
AxonTestFixture
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance ofCustomization.Customization(boolean axonServerEnabled, List<FieldFilter> fieldFilters) Creates an instance of aCustomizationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether Axon Server is disabled.booleanIndicates whether Axon Server is enabled.Configures Axon Server to be disabled.final booleanIndicates whether some other object is "equal to" this one.Configured field filters.final inthashCode()Returns a hash code value for this object.registerFieldFilter(FieldFilter fieldFilter) Registers the givenfieldFilter, which is used to define which Fields are used when comparing objects.registerIgnoredField(Class<?> declaringClass, String fieldName) Indicates that a field with givenfieldName, which is declared in givendeclaringClassis ignored when performing deep equality checks.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Customization
public Customization()Creates a new instance ofCustomization. -
Customization
Creates an instance of aCustomizationrecord class.- Parameters:
axonServerEnabled- the value for theaxonServerEnabledrecord componentfieldFilters- the value for thefieldFiltersrecord component
-
-
Method Details
-
registerFieldFilter
Registers the givenfieldFilter, which is used to define which Fields are used when comparing objects.This filter is used by the following methods:
AxonTestPhase.Then.MessageAssertions.events(java.lang.Object...)AxonTestPhase.Then.MessageAssertions.commands(java.lang.Object...)AxonTestPhase.Then.Command.resultMessagePayload(java.lang.Object)
If you use custom assertions with methods like
When multiple filters are registered, a Field must be accepted by all registered filters in order to be accepted. By default, all Fields are included in the comparison.AxonTestPhase.Then.MessageAssertions.eventsSatisfy(java.util.function.Consumer<java.util.List<org.axonframework.messaging.eventhandling.EventMessage>>)orAxonTestPhase.Then.MessageAssertions.eventsMatch(java.util.function.Predicate<java.util.List<org.axonframework.messaging.eventhandling.EventMessage>>)this filter is not taken into account.- Parameters:
fieldFilter- The FieldFilter that defines which fields to include in the comparison.- Returns:
- the current Customization, for fluent interfacing.
-
registerIgnoredField
public AxonTestFixture.Customization registerIgnoredField(@Nonnull Class<?> declaringClass, @Nonnull String fieldName) Indicates that a field with givenfieldName, which is declared in givendeclaringClassis ignored when performing deep equality checks.This filter is used by the following methods:
AxonTestPhase.Then.MessageAssertions.events(java.lang.Object...)AxonTestPhase.Then.MessageAssertions.commands(java.lang.Object...)AxonTestPhase.Then.Command.resultMessagePayload(java.lang.Object)
If you use custom assertions with methods like
AxonTestPhase.Then.MessageAssertions.eventsSatisfy(java.util.function.Consumer<java.util.List<org.axonframework.messaging.eventhandling.EventMessage>>)orAxonTestPhase.Then.MessageAssertions.eventsMatch(java.util.function.Predicate<java.util.List<org.axonframework.messaging.eventhandling.EventMessage>>)this filter is not taken into account.- Parameters:
declaringClass- The class declaring the field.fieldName- The name of the field.- Returns:
- the current Customization, for fluent interfacing
- Throws:
FixtureExecutionException- when no such field is declared
-
fieldFilters
Configured field filters.- Returns:
- The list of field filters.
-
disableAxonServer
Configures Axon Server to be disabled.- Returns:
- The current Customization, for fluent interfacing.
-
axonServerEnabled
public boolean axonServerEnabled()Indicates whether Axon Server is enabled.- Returns:
- True if Axon Server is enabled, false otherwise.
-
axonServerDisabled
public boolean axonServerDisabled()Indicates whether Axon Server is disabled.- Returns:
- True if Axon Server is disabled, false otherwise.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='.
-