Hi Yeah that is a good question. AdviceWith is a great feature for unit testing and we should ensure it's still possible and easy to use. Otavio is leading this effort and it would be good to get his attention to this matter.
On Mon, Aug 12, 2024 at 10:00 AM Castermans, Thom <thom.casterm...@ordina.nl.invalid> wrote: > Hello Camel users, > > > (Prefix: I have asked this question on Stack Overflow [1] last week, but > think this might be a better venue. I will update the Q&A with anything I > learn here.) > > Our team has recently upgraded to Camel 4.7.0 and learned about the > ongoing work to streamline the CamelTestSupport class (CAMEL-20785, > CAMEL-20843). This impacted our route unit tests, which extend > CamelTestSupport and override `isUseAdviceWith` to return true, in order to > avoid the Camel context restarting upon actually advicing a route. We > manually start the context in each test. > > In the process of resolving the deprecations introduced by the upgrade, we > were trying to figure out what the advised (no pun intended) way forward > is. We found the `setupResources` method that can be overridden, but also > warns about doing that in its JavaDoc. We also found > `testConfigurationBuilder.withUseAdviceWith(true);`, but since that method > is protected, it cannot be called from the unit test. Is that intentional? > > In short: what is the advised way to use CamelTestSupport (in the future)? > If this is work-in-progress, where can we track it to keep up-to-date? > > > Best regards, thank you, > Thom Castermans > > > [1]: > https://stackoverflow.com/questions/78844486/how-can-i-enable-useadvicewith-in-a-cameltestsupport-unit-test > > Disclaimer > Dit bericht met eventuele bijlagen is vertrouwelijk en uitsluitend bestemd > voor de geadresseerde. Indien u niet de bedoelde ontvanger bent, wordt u > verzocht de afzender te waarschuwen en dit bericht met eventuele bijlagen > direct te verwijderen en/of te vernietigen. Het is niet toegestaan dit > bericht en eventuele bijlagen te vermenigvuldigen, door te sturen, openbaar > te maken, op te slaan of op andere wijze te gebruiken. Ordina Holding B.V. > en/of haar groepsmaatschappijen accepteren geen verantwoordelijkheid of > aansprakelijkheid voor schade die voortvloeit uit de inhoud en/of de > verzending van dit bericht. > > This e-mail and any attachments are confidential and are solely intended > for the addressee. If you are not the intended recipient, please notify the > sender and delete and/or destroy this message and any attachments > immediately. It is prohibited to copy, to distribute, to disclose or to use > this e-mail and any attachments in any other way. Ordina Holding B.V. > and/or its group companies do not accept any responsibility nor liability > for any damage resulting from the content of and/or the transmission of > this message. > -- Claus Ibsen ----------------- @davsclaus Camel in Action 2: https://www.manning.com/ibsen2