This is an automated email from the ASF dual-hosted git repository. ppalaga pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push: new 68d5fcf682 Be more specific when to use a ConsumerTemplate in extension tests (#4889) 68d5fcf682 is described below commit 68d5fcf6826ed056c49facdcd4660ca9d3c44c92 Author: Peter Palaga <ppal...@redhat.com> AuthorDate: Thu May 11 17:48:44 2023 +0200 Be more specific when to use a ConsumerTemplate in extension tests (#4889) * Be more specific when to use a ConsumerTemplate in extension tests * Update docs/modules/ROOT/pages/contributor-guide/extension-testing.adoc Co-authored-by: James Netherton <jamesnether...@users.noreply.github.com> --------- Co-authored-by: James Netherton <jamesnether...@users.noreply.github.com> --- .../ROOT/pages/contributor-guide/extension-testing.adoc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/modules/ROOT/pages/contributor-guide/extension-testing.adoc b/docs/modules/ROOT/pages/contributor-guide/extension-testing.adoc index 080d6e2e44..c7cac36906 100644 --- a/docs/modules/ROOT/pages/contributor-guide/extension-testing.adoc +++ b/docs/modules/ROOT/pages/contributor-guide/extension-testing.adoc @@ -20,7 +20,15 @@ Here are the directories containing integration tests: The application under test lives under `src/main` directory of the test module. It should typically contain one or more Camel routes that utilize the Camel component brought by the extension under test. -If it helps to avoid additional dependencies, using `@ConsumerTemplate` and/or `@ProducerTemplate` may be favorable over having a full-fledged route. + +`ProducerTemplate` may be favorable over having a full-fledged route, e.g. when it helps to avoid additional dependencies +or where it helps to keep the test application simple. + +On the other hand, the use of `ConsumerTemplate` should be assessed carefully. +In some cases, it may use a different `Consumer` implementation (polling vs. non-polling) +than what would be used by the given component in a route. +Thus, a test application with `ConsumerTemplate` may miss covering important execution paths. +The rule of thumb is to use `ConsumerTemplate` only for components whose default consumer implements `PollingConsumer`. === Tests