camel icon indicating copy to clipboard operation
camel copied to clipboard

CamelTestSupport: removal of wrong annotation + addition of method for @Override

Open JiriOndrusek opened this issue 1 year ago • 3 comments

fixes https://issues.apache.org/jira/browse/CAMEL-20784

I remoced the annotation (CamelQuarkusTest) which does not exist and I moved the validation into a protected method. Child class is able to override the behavior if needed.

Description

Target

  • [ ] I checked that the commit is targeting the correct branch (note that Camel 3 uses camel-3.x, whereas Camel 4 uses the main branch)

Tracking

  • [ ] If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • [ ] I checked that each commit in the pull request has a meaningful subject line and body.
  • [ ] I have run mvn clean install -DskipTests locally and I have committed all auto-generated changes

JiriOndrusek avatar May 17 '24 12:05 JiriOndrusek

:star2: Thank you for your contribution to the Apache Camel project! :star2:

:robot: CI automation will test this PR automatically.

:camel: Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run

  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot.

  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.

  • Build and test logs are available in the Summary page. Only Apache Camel committers have access to the summary.

  • :warning: Be careful when sharing logs. Review their contents before sharing them publicly.

github-actions[bot] avatar May 17 '24 12:05 github-actions[bot]

FYI @orpiske Ideally I'd use 'claszz.isAssignableFrom(CamelQuarkusTestSupport.class' instead of moving the validation into protected method. But because I can use only String name of the class, I'd need to find class by name and handle ClassNotFoundException. I see solution in this PR clearer for the users. In case you disagree I'll refactor it differently. (I see positives and negatives in both solutions)

JiriOndrusek avatar May 17 '24 12:05 JiriOndrusek

~As for the CAMEL-20784, I think we should investigate if Java's sealed classes can solve the problem.~

Likely can't, based on my conversation with @JiriOndrusek.

orpiske avatar May 17 '24 12:05 orpiske

@JiriOndrusek I think we can close this one, right?

orpiske avatar May 31 '24 11:05 orpiske

This has become invalid in the context of CAMEL-20785 changes. Let's close it.

orpiske avatar Jun 06 '24 06:06 orpiske