Testing @EntityListener with JUnit

how are you testing the @EntityListeners in Axon?

Within spring it should be something like in @Before create some data with commands. And then in methods test event processing.

But this could be problem while testing view builders, because they are asynchronous so views shouldn’t contain the expected data. Is the good option to poll for view?



basically, I treat them as normal object when testing. Create some initial state and invoke the handler methods directly.