Hello,
I can't solve issue (maybe it's my bad configuration) when doing test. There is one UserTest class which is testing command/event with fixture.
When command is distributed to commandHandler (UserCommandHandler) nullpointerexception is thrown because application complains that Repository is not available (is null) but that's not true, because when I point to setUserRepository method, I can see that repository is being injected.
Is Axon creating separate bean of commandHandler and holding it somewhere inside it context?
I have this excption:
org.axonframework.test.AxonAssertionError: The published events do not match the expected events
Expected | Actual
--------------------------------------------------------------------|--------------------------------------------------------------------
com.github.bilak.axonframework.poc.domain.user.UserRegisteredEvent <|>
A probable cause for the wrong chain of events is an exception that occurred while handling the command.
java.lang.NullPointerException
at com.github.bilak.axonframework.poc.command.user.UserCommandHandler.handleRegisterUser(UserCommandHandler.java:22)
can somebody please suggest some fix for this?
Thanks