You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Adjust heartbeat configuration example to show how to disable it, as
enabled is the default.
- Replace sort for filter in the handler-enhancers.md section, as that's
more to the point
- Drop "command handling components" notice from the given phase
description, as it's the aggregate under test. Emphasize the
registerAnnotatedCommandHandler option with a link to external command
handlers as a replacement.
#304
Copy file name to clipboardExpand all lines: appendices/message-handler-tuning/handler-enhancers.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ You can use handler enhancers to intercept and perform checks on groups of `@Mes
9
9
To create a handler enhancer, you implement the `HandlerEnhancerDefinition` interface and override the `wrapHandler()` method.
10
10
All this method does is give you access to the `MessageHandlingMember<T>`, which is an object representing any handler specified in the system.
11
11
12
-
You can then sort these handlers based on the type of `Message` they handle by using the `MessageHandlingMember.canHandleMessageType(Class<? extends Message>)` method.
12
+
You can then filter these handlers based on the type of `Message` they handle by using the `MessageHandlingMember.canHandleMessageType(Class<? extends Message>)` method.
13
13
Doing so, you can specifically enhance message handlers dealing with, for example, the `CommandMessage`.
14
14
15
15
For your handler enhancer to run, you'll need to create a `META-INF/services/org.axonframework.messaging.annotation.HandlerEnhancerDefinition` file containing the fully qualified class name of the handler enhancer you have created or register the enhancer explicitly in the `Configurer`.
@@ -67,7 +67,7 @@ public @interface MyAnnotation {
67
67
68
68
1. Implement the `HandlerEnhancerDefinition` interface
69
69
2. Override the `wrapHandler` method to perform your logic.
70
-
3.Sort out the types of handlers you want to wrap based on a specific attribute, for example, the `metaDataKey` attribute from the `MyAnnotation`.
70
+
3.Filter the types of handlers you want to wrap based on a specific attribute, for example, the `metaDataKey` attribute from the `MyAnnotation`.
71
71
4. Handle the method inside of a `MessageHandlingMember`. In this case, indicating the handler is only suitable if the meta-data key matches a value.
72
72
5. For annotation-specific attributes to exist in the `MessageHandlingMember's` attribute collection, meta-annotation the custom annotation with `HasHandlerAttributes`.
73
73
6. If you are not interested in wrapping the handler, return the original passed into the `wrapHandler` method.
Copy file name to clipboardExpand all lines: axon-framework/testing/commands-events.md
+5-8Lines changed: 5 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -83,10 +83,6 @@ public class GiftCardTest {
83
83
>}
84
84
>```
85
85
86
-
87
-
88
-
89
-
90
86
The"given-when-then" test fixture defines three stages: configuration, execution and validation. Each of these stages is represented by a different interface: `FixtureConfiguration`, `TestExecutor` and `ResultValidator`, respectively.
91
87
92
88
>**FluentInterface**
@@ -111,7 +107,7 @@ During the configuration phase \(i.e. before the first "given" is provided\), yo
111
107
112
108
* `registerAnnotatedCommandHandler`:
113
109
114
-
Registers a Annotated Command Handler object.
110
+
Registers a [Annotated Command Handler object](../axon-framework-commands/command-handlers.md#external-command-handlers) that interacts with the aggregate.
115
111
Use this method to register components containing `@CommandHandler` annotated methods that invoke the `Repository` to execute operation on an aggregate.
116
112
You may end up in such a scenario when you prefer that command handlers and/or command messages are not contained inside the domain model (i.e. the aggregate).
117
113
@@ -170,7 +166,7 @@ During the configuration phase \(i.e. before the first "given" is provided\), yo
170
166
### Given Phase
171
167
172
168
Once you have configured the fixture, you can start the given phase.
173
-
Axon's test fixtures provide several given methods aligning with the modeling option of the aggregate.
169
+
Axon's test fixtures provide several given methods aligning with the modeling options of an aggregate.
174
170
Below is a list of all the operations of the given phase:
175
171
176
172
* `givenNoPriorActivity`:
@@ -219,7 +215,7 @@ We can separate the execution phase options into roughly three variants:
219
215
Below is a list of all the operations you can use in the execution phase:
220
216
221
217
* `when(Object)`:
222
-
Using the `when` method, you can provide a command for the fixture to execute against the command handling component under test.
218
+
Using the `when` method, you can provide a command for the fixture to execute against the aggregate under test.
223
219
Similar to the given events, if the provided command is of type `CommandMessage`, the fixture dispatches it as is.
224
220
The fixture monitors the behavior of the invoked handler \(either on the aggregate or as an external handler\) and compares it to the expectations you register in the [validation phase](#validation-phase).
225
221
* `when(Object, Map<String, ?>)`:
@@ -242,7 +238,8 @@ Below is a list of all the operations you can use in the execution phase:
242
238
243
239
### ValidationPhase
244
240
245
-
The last phase is the validation phase, which allows you to check on the activities of the command handling component. This is generally done purely in terms of return values and events.
241
+
The last phase is the validation phase, which allows you to check on the activities of the aggregate.
242
+
This is generally done purely in terms of return values and events.
0 commit comments