You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2022/10/11 14:44:24 UTC
[camel] branch main updated: CAMEL-18601: replace assertMockEndpointsSatisfied() in doc (#8518)
This is an automated email from the ASF dual-hosted git repository.
nfilotto 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 6da9ba16648 CAMEL-18601: replace assertMockEndpointsSatisfied() in doc (#8518)
6da9ba16648 is described below
commit 6da9ba16648f90a70872e441d021fd99051832b2
Author: Marco Carletti <mc...@redhat.com>
AuthorDate: Tue Oct 11 16:44:08 2022 +0200
CAMEL-18601: replace assertMockEndpointsSatisfied() in doc (#8518)
---
components/camel-mina/src/main/docs/mina-component.adoc | 2 +-
components/camel-seda/src/main/docs/seda-component.adoc | 4 ++--
.../camel-test/camel-test-junit5/src/main/docs/test-junit5.adoc | 4 +++-
docs/user-manual/modules/ROOT/pages/advice-with.adoc | 2 +-
4 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/components/camel-mina/src/main/docs/mina-component.adoc b/components/camel-mina/src/main/docs/mina-component.adoc
index 95feb8afff4..e65f2e25b2c 100644
--- a/components/camel-mina/src/main/docs/mina-component.adoc
+++ b/components/camel-mina/src/main/docs/mina-component.adoc
@@ -113,7 +113,7 @@ mock.expectedBodiesReceived("Hello World");
template.sendBody("mina:tcp://localhost:" + port1 + "?textline=true&sync=false", "Hello World");
-assertMockEndpointsSatisfied();
+MockEndpoint.assertIsSatisfied(context);
-------------------------------------------------------------------------------------------------
=== Sample with sync=true
diff --git a/components/camel-seda/src/main/docs/seda-component.adoc b/components/camel-seda/src/main/docs/seda-component.adoc
index 187bd0fbbf7..0125f7d2df1 100644
--- a/components/camel-seda/src/main/docs/seda-component.adoc
+++ b/components/camel-seda/src/main/docs/seda-component.adoc
@@ -175,7 +175,7 @@ We send a Hello World message and expects the reply to be OK.
assertEquals("OK", out);
// END SNIPPET: e2
- assertMockEndpointsSatisfied();
+ MockEndpoint.assertIsSatisfied(context);
}
@Override
@@ -215,7 +215,7 @@ In this example we have defined two consumers.
template.sendBody("seda:foo", "Hello World");
- assertMockEndpointsSatisfied();
+ MockEndpoint.assertIsSatisfied(context);
}
@Override
diff --git a/components/camel-test/camel-test-junit5/src/main/docs/test-junit5.adoc b/components/camel-test/camel-test-junit5/src/main/docs/test-junit5.adoc
index 34ce746df66..1e122d5850c 100644
--- a/components/camel-test/camel-test-junit5/src/main/docs/test-junit5.adoc
+++ b/components/camel-test/camel-test-junit5/src/main/docs/test-junit5.adoc
@@ -24,6 +24,7 @@ see more at the javadoc of this class.
----
import org.apache.camel.RoutesBuilder;
import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.junit.jupiter.api.Test;
@@ -35,7 +36,7 @@ public class SimpleMockTest extends CamelTestSupport {
template.sendBody("direct:start", "Hello World");
- assertMockEndpointsSatisfied();
+ MockEndpoint.assertIsSatisfied(context);
}
@Override
@@ -77,6 +78,7 @@ TIP: It's possible to run JUnit4 & JUnit5 based Camel tests side by side includi
* Usage of the method `CamelTestSupport.createRegistry` should be replaced by `CamelTestSupport.createCamelRegistry()`
* Overrides of `isCreateCamelContextPerClass()` returning `false` should be removed
* Overrides of `isCreateCamelContextPerClass()` returning `true` should be replaced by `@TestInstance(Lifecycle.PER_CLASS)`
+* Usage of the method `CamelTestSupport.assertMockEndpointsSatisfied` should be replaced by `MockEndpoint.assertIsSatisfied(context)`
Once Camel related steps have been performed, there are still typical JUnit 5 migration steps to remember:
diff --git a/docs/user-manual/modules/ROOT/pages/advice-with.adoc b/docs/user-manual/modules/ROOT/pages/advice-with.adoc
index f247f9bb3f2..cebd1feba54 100644
--- a/docs/user-manual/modules/ROOT/pages/advice-with.adoc
+++ b/docs/user-manual/modules/ROOT/pages/advice-with.adoc
@@ -218,7 +218,7 @@ public void testMockEndpoints() throws Exception {
// send messages
- assertMockEndpointsSatisfied();
+ MockEndpoint.assertIsSatisfied(context);
}
----