Pass the command result type to CommandGateway.send and sendAndWait

Proprietary

Axon Framework 4 inferred the result type of CommandGateway.send(command) and sendAndWait(command) from the code that used the result. Axon Framework 5 takes it as a second argument, send(command, Result.class), and otherwise returns a CommandResult or an Object. This passes the type Axon Framework 4 inferred. A result that is ignored, or used only as an Object, is left alone, as is a send whose result type is generic, such as List<String>. sendAndWait gets the raw class for a generic result, sendAndWait(command, List.class).

io.moderne.axon.AddCommandResultType
mod run . --recipe=io.moderne.axon.AddCommandResultType

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.