Skip to content

Feature/handler test case #3606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Feature/handler test case #3606

wants to merge 2 commits into from

Conversation

hjohn
Copy link
Collaborator

@hjohn hjohn commented Aug 14, 2025

Adds:

Open questions:

  • Did I miss any useful cases?
  • Should I leave in the comments / Disabled tests?
  • Should this be named TestSuite or Test?

@hjohn hjohn requested a review from a team as a code owner August 14, 2025 21:22
@hjohn hjohn requested review from abuijze, smcvb and MateuszNaKodach and removed request for a team August 14, 2025 21:22
Copy link

@smcvb smcvb added Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. Type: Enhancement Use to signal an issue enhances an already existing feature of the project. labels Aug 15, 2025
@smcvb smcvb added this to the Release 5.0.0-M3 milestone Aug 15, 2025
Copy link
Member

@smcvb smcvb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting some minor changes. But in all, I think the structure is fair!
Let me reply to your main description comments here too:

Did I miss any useful cases?

I am missing the Event Handler cases. To validate void works (super simple/dumb, of course), CompletableFuture<?> works, and Mono<?> works, but without taking any concrete result that might be given by the subscribed event handler.

Should I leave in the comments / Disabled tests?

As long as disabled tests refer to todos which refer to issue numbers, that's all fair game!

Should this be named TestSuite or Test?

I my head, a test-suite is a(n abstract) class that has concrete implementations for concrete scenarios. An example of this is the MessageTestSuite, ConverterTestSuite, or EventStorageEngineTestSuite. Each expect the construction of a test subject.

The form you've created, to me, is a regular test. Looking at the structure you've given rise to, I do think it is fine to keep it a test instead of making it into a test suite.

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

public class AsyncMessageHandlerTest {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: you could make the class and test methods package-private.

@@ -0,0 +1,201 @@
package org.axonframework.messaging;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing the copyright notice. You can take the copyright-template.xml for that!


@Test
public void annotatedQueryHandlerShouldUseIterableReturnType() {
// TODO missing subscribe method for potential AnnotatedQueryHandlingComponent
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you might be missing the fact we haven't rewritten the Query side yet. You can add #3488 to the TODO for clarity to those picking up #3488 that this test should be dealt with.

assertCommands();
}

// TODO there seems to be a difference between how CommandHandler and QueryHandler can be subscribed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This discrepancy has to do with the QueryBus not having been rewritten to be a QueryHandlerRegistry yet. That should be tackled in issue #3488 too.


assertCommands();
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am missing validations for Event Handlers! Or do you want to further discuss that in one of the design sessions? :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. Type: Enhancement Use to signal an issue enhances an already existing feature of the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants