Skip to content

feat: Expose CamelContextConfiguration.replaceRouteFromWith(String, String) as API #17758

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

Merged

Conversation

apupier
Copy link
Contributor

@apupier apupier commented Apr 15, 2025

This would be convenient to replace the deprecated org.apache.camel.test.junit5.AbstractTestSupport.replaceRouteFromWith(String, String)

A workaround avoiding deprecated API is currently to use:

    @Override
    public void configureContext(CamelContextConfiguration
camelContextConfiguration) {
    	super.configureContext(camelContextConfiguration);
    	camelContextConfiguration.fromEndpoints().put(routeId,
"direct:in");
    }

for instance, could be replaced then here https://github.com/apache/camel-examples/blob/218836af4251d9ecb70f18dedb3b2e4511925767/kafka/src/test/java/org/apache/camel/example/kafka/KafkaTest.java#L60-L64

Description

Target

  • I checked that the commit is targeting the correct branch (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 from root folder and I have committed all auto-generated changes.

org.apache.camel.test.junit5.CamelContextConfiguration.replaceRouteFromWith(String,
String) as API

This would be convenient to replace the deprecated
org.apache.camel.test.junit5.AbstractTestSupport.replaceRouteFromWith(String,
String)

A workaround avoiding deprecated API is currently to use:
```
    @OverRide
    public void configureContext(CamelContextConfiguration
camelContextConfiguration) {
    	super.configureContext(camelContextConfiguration);
    	camelContextConfiguration.fromEndpoints().put(routeId,
"direct:in");
    }
```

Signed-off-by: Aurélien Pupier <[email protected]>
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟

🤖 CI automation will test this PR automatically.

🐫 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.

  • ⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@apupier apupier marked this pull request as ready for review April 15, 2025 14:49
@apupier apupier requested a review from orpiske April 15, 2025 14:49
@apupier apupier merged commit e92e251 into apache:main Apr 17, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants