Hi Federico, I looked into it a bit more and realized the issue was due to autowiring the Camel context through the constructor of the test class. https://gist.github.com/0x6A75626172/c7aa6c1c925087a11fa0f836dd6add76 When I autowire the fields directly like your reproducer it also works for me. Thanks for the help!
Kind Regards, jubar Sent with Proton Mail secure email. On Thursday, July 31st, 2025 at 15:29, Federico Mariani <federico.mariani.1...@gmail.com> wrote: > Hi Jubar, > > I think I reproduced a similar scenario, and the test is successful, > https://gist.github.com/Croway/24ba7620d52ed528aa13e13c70678e25 can you > share a reproducer? in particular, without the DirtiesContext, the 2nd test > fails on the first assertion, due to Camel Context already started, > otherwise, this is working as expected, tested with Camel Spring Boot > 4.14.0-SNAPSHOT > > Federico > > Il giorno gio 31 lug 2025 alle ore 14:14 j_b_s34 j_b_...@proton.me.invalid > > ha scritto: > > > Hi everyone, > > > > is @CamelSpringBootTest incompatible with the combination of > > @DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) and > > @UseAdviceWith? > > Only my first test method is executed successful. The methods after it > > fail because the camel context starts immediately before the adviceWith > > configs are executed. > > Is there a workaround or fix? > > > > Kind regards, > > jubar. > > > > Sent with Proton Mail secure email.