This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-website.git
The following commit(s) were added to refs/heads/main by this push: new 8cea57a2 Minor cleanups in the blog post about the modernization of the test support code 8cea57a2 is described below commit 8cea57a29ce214a911f5c6b819e329c4b147074f Author: Otavio Rodolfo Piske <angusyo...@gmail.com> AuthorDate: Thu Sep 12 10:32:53 2024 +0200 Minor cleanups in the blog post about the modernization of the test support code --- content/blog/2024/09/modernizing-test-support/index.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/content/blog/2024/09/modernizing-test-support/index.md b/content/blog/2024/09/modernizing-test-support/index.md index ac0d3311..a9ce140e 100644 --- a/content/blog/2024/09/modernizing-test-support/index.md +++ b/content/blog/2024/09/modernizing-test-support/index.md @@ -37,8 +37,12 @@ The refactoring of the test support classes is one of those. Although, the chang To ensure a smooth transition, the very first thing that our users should pay attention to is to avoid relying on deprecated interfaces. In many cases, they are used for pre- and post-test setup. As such, that code can almost always be safely replaced by JUnit's setup and tear-down code (represented by annotations such as `@BeforeEach` and `@AfterEach`). -The second is to use the new classes `TestExecutionConfiguration` and `CamelContextConfiguration` (via their accessor methods) for adjusting the test and the Camel Context behavior. -The third, is to avoid relying on the per-class lifecycle (i.e.: annotating the tests with `@TestInstance(TestInstance.Lifecycle.PER_CLASS)`) - with Camel 4.9 this will trigger the legacy context management code which will, eventually, be removed. + +The second is to use the new classes `TestExecutionConfiguration` and `CamelContextConfiguration` (via their accessor methods) +for adjusting the test and the Camel Context behavior. + +The third, is to avoid relying on the per-class lifecycle (i.e.: annotating the tests with `@TestInstance(TestInstance.Lifecycle.PER_CLASS)`). +With Camel 4.9, this will trigger the legacy context management code which will, eventually, be removed. The migration can also be made easier, by applying a few additional good practices for writing tests, such as ensuring a clean environment between tests. For instance, in some cases, it might be necessary to reset the mocks between each test execution.