jamesnetherton commented on issue #7140:
URL: https://github.com/apache/camel-quarkus/issues/7140#issuecomment-2732009616
This simple advice test works for me across multiple versions:
```java
@QuarkusTest
public class AdviceTest extends CamelQuarkusTestSupport {
@Override
public boolean isUseAdviceWith() {
return true;
}
@BeforeEach
public void beforeEach() throws Exception {
AdviceWith.adviceWith(this.context, "advisedRoute", route -> {
route.replaceFromWith("direct:replaced");
});
startRouteDefinitions();
}
@Override
protected RoutesBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:start").routeId("advisedRoute")
.transform().simple("Hello ${body}")
.to("mock:result");
from("direct:other")
.log("Hi");
}
};
}
@Test
void testAdvisedRoute() throws Exception {
MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
mockEndpoint.expectedBodiesReceived("Hello World");
template.sendBody("direct:replaced", "World");
template.sendBody("direct:other", "Hello World");
mockEndpoint.assertIsSatisfied();
}
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]