This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new fc880bac9165 Remove usage of deprecated sendBody in tests of LRA
component (#24499)
fc880bac9165 is described below
commit fc880bac9165f9873aa2a22a7a4cc49fbd7e4541
Author: Aurélien Pupier <[email protected]>
AuthorDate: Tue Jul 7 18:42:00 2026 +0200
Remove usage of deprecated sendBody in tests of LRA component (#24499)
Remove usage of deprecated sendBody in tests of LRA component
Replaces deprecated CamelTestSupport.sendBody() calls with the equivalent
TestSupport.sendBody(template, ...) static method in 3 LRA test files.
---
.../src/test/java/org/apache/camel/service/lra/LRAFailuresIT.java | 5 +++--
.../src/test/java/org/apache/camel/service/lra/LRAManualIT.java | 7 ++++---
.../java/org/apache/camel/service/lra/LRAManualInMemoryTest.java | 7 ++++---
3 files changed, 11 insertions(+), 8 deletions(-)
diff --git
a/components/camel-lra/src/test/java/org/apache/camel/service/lra/LRAFailuresIT.java
b/components/camel-lra/src/test/java/org/apache/camel/service/lra/LRAFailuresIT.java
index 26ea66c2d65d..5d4fb74f489e 100644
---
a/components/camel-lra/src/test/java/org/apache/camel/service/lra/LRAFailuresIT.java
+++
b/components/camel-lra/src/test/java/org/apache/camel/service/lra/LRAFailuresIT.java
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.apache.camel.RuntimeCamelException;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit6.TestSupport;
import org.junit.jupiter.api.Test;
import static org.awaitility.Awaitility.await;
@@ -37,7 +38,7 @@ public class LRAFailuresIT extends AbstractLRATestSupport {
MockEndpoint compensate = getMockEndpoint("mock:compensate");
compensate.expectedMessageCount(1);
- sendBody("direct:saga-compensate", "hello");
+ TestSupport.sendBody(template, "direct:saga-compensate", "hello");
await().atMost(20, TimeUnit.SECONDS)
.until(() -> compensate.getReceivedCounter() >= 1);
@@ -54,7 +55,7 @@ public class LRAFailuresIT extends AbstractLRATestSupport {
MockEndpoint end = getMockEndpoint("mock:end");
end.expectedBodiesReceived("hello");
- sendBody("direct:saga-complete", "hello");
+ TestSupport.sendBody(template, "direct:saga-complete", "hello");
await().atMost(20, TimeUnit.SECONDS)
.until(() -> complete.getReceivedCounter() >= 1
diff --git
a/components/camel-lra/src/test/java/org/apache/camel/service/lra/LRAManualIT.java
b/components/camel-lra/src/test/java/org/apache/camel/service/lra/LRAManualIT.java
index 1b3453e4bbee..127d7c2e7e36 100644
---
a/components/camel-lra/src/test/java/org/apache/camel/service/lra/LRAManualIT.java
+++
b/components/camel-lra/src/test/java/org/apache/camel/service/lra/LRAManualIT.java
@@ -23,6 +23,7 @@ import org.apache.camel.RoutesBuilder;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.model.SagaCompletionMode;
+import org.apache.camel.test.junit6.TestSupport;
import org.junit.jupiter.api.Test;
public class LRAManualIT extends AbstractLRATestSupport {
@@ -33,7 +34,7 @@ public class LRAManualIT extends AbstractLRATestSupport {
completeEndpoint.expectedMessageCount(1);
completeEndpoint.expectedHeaderReceived("id", "1");
- sendBody("direct:saga", "hello", Collections.singletonMap("myid",
"1"));
+ TestSupport.sendBody(template, "direct:saga", "hello",
Collections.singletonMap("myid", "1"));
completeEndpoint.assertIsSatisfied();
}
@@ -43,7 +44,7 @@ public class LRAManualIT extends AbstractLRATestSupport {
MockEndpoint compensateEndpoint = getMockEndpoint("mock:compensate");
compensateEndpoint.expectedMessageCount(1);
- sendBody("direct:saga", "fail");
+ TestSupport.sendBody(template, "direct:saga", "fail");
compensateEndpoint.assertIsSatisfied();
}
@@ -53,7 +54,7 @@ public class LRAManualIT extends AbstractLRATestSupport {
MockEndpoint compensateEndpoint = getMockEndpoint("mock:compensate");
compensateEndpoint.expectedMessageCount(1);
- sendBody("direct:saga", "timeout");
+ TestSupport.sendBody(template, "direct:saga", "timeout");
compensateEndpoint.assertIsSatisfied();
}
diff --git
a/components/camel-lra/src/test/java/org/apache/camel/service/lra/LRAManualInMemoryTest.java
b/components/camel-lra/src/test/java/org/apache/camel/service/lra/LRAManualInMemoryTest.java
index 4db03b163e12..8bb01c3093c8 100644
---
a/components/camel-lra/src/test/java/org/apache/camel/service/lra/LRAManualInMemoryTest.java
+++
b/components/camel-lra/src/test/java/org/apache/camel/service/lra/LRAManualInMemoryTest.java
@@ -26,6 +26,7 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.model.SagaCompletionMode;
import org.apache.camel.saga.InMemorySagaService;
import org.apache.camel.test.junit6.CamelTestSupport;
+import org.apache.camel.test.junit6.TestSupport;
import org.junit.jupiter.api.Test;
public class LRAManualInMemoryTest extends CamelTestSupport {
@@ -46,7 +47,7 @@ public class LRAManualInMemoryTest extends CamelTestSupport {
completeEndpoint.expectedMessageCount(1);
completeEndpoint.expectedHeaderReceived("id", "1");
- sendBody("direct:saga", "hello", Collections.singletonMap("myid",
"1"));
+ TestSupport.sendBody(template, "direct:saga", "hello",
Collections.singletonMap("myid", "1"));
completeEndpoint.assertIsSatisfied();
}
@@ -56,7 +57,7 @@ public class LRAManualInMemoryTest extends CamelTestSupport {
MockEndpoint compensateEndpoint = getMockEndpoint("mock:compensate");
compensateEndpoint.expectedMessageCount(1);
- sendBody("direct:saga", "fail");
+ TestSupport.sendBody(template, "direct:saga", "fail");
compensateEndpoint.assertIsSatisfied();
}
@@ -66,7 +67,7 @@ public class LRAManualInMemoryTest extends CamelTestSupport {
MockEndpoint compensateEndpoint = getMockEndpoint("mock:compensate");
compensateEndpoint.expectedMessageCount(1);
- sendBody("direct:saga", "timeout");
+ TestSupport.sendBody(template, "direct:saga", "timeout");
compensateEndpoint.assertIsSatisfied();
}