You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2023/02/06 07:48:45 UTC

[GitHub] [camel] gnodet commented on a diff in pull request #9272: Remove deprecated XmlRoutesDefinitionLoader

gnodet commented on code in PR #9272:
URL: https://github.com/apache/camel/pull/9272#discussion_r1097037218


##########
dsl/camel-xml-jaxb-dsl-test/definition/src/test/java/org/apache/camel/dsl/xml/jaxb/definition/LoadRestFromXmlTest.java:
##########
@@ -54,10 +52,9 @@ public void testLoadRestsDefinitionFromXml() throws Exception {
         foo.assertIsSatisfied();
 
         // load rest from XML and add them to the existing camel context
-        InputStream is = getClass().getResourceAsStream("barRest.xml");
         ExtendedCamelContext ecc = context.adapt(ExtendedCamelContext.class);
-        RestsDefinition rests = (RestsDefinition) ecc.getXMLRoutesDefinitionLoader().loadRestsDefinition(ecc, is);
-        context.addRestDefinitions(rests.getRests(), true);
+        Resource resource = ecc.getResourceLoader().resolveResource("org/apache/camel/dsl/xml/jaxb/definition/barRest.xml");
+        ecc.getRoutesLoader().loadRoutes(resource);

Review Comment:
   I think this should be done in a separate commit if there's really a need to make a reusable method, as it would span a bunch of additional files.  
   But if that's really something that should be reused, maybe a better place would be on the `ExtendedCamelContext` directly, as it would benefit end users too.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org