allthingssecurity opened a new pull request, #27527: URL: https://github.com/apache/camel/pull/27527
# Description [CAMEL-24989](https://issues.apache.org/jira/browse/CAMEL-24989) Filed by @davsclaus. In JUnit 5, a method that overrides a `@Test` method is only a test if it declares `@Test` itself, so these overrides were silently skipped and the classes showed green. - `SpringSamplingThrottlerTest` (camel-spring-xml): the six overrides only called super, so they are removed and the inherited tests run. The Spring XML had all the routes they need except `direct:sample-placeholder`, which is added with a `<propertyPlaceholder>` for `sample.period`. The Spring routes are created when the application context is refreshed, before the test applies `useOverridePropertiesWithPropertiesComponent`, which is why the route was removed in #22928 and the test suppressed in #22929. The class goes from 1 to 7 tests, all passing. - `MllpTcpServerConsumerOptionalEndOfDataWithoutValidationTest` (camel-mllp): the seven overrides with their own expectations get `@Test`, like the sibling classes. The class goes from 8 to 15 tests, all passing. History of the overrides: #22929 dropped `@Test` on `testSamplingWithPropertyPlaceholder` on purpose, because #22928 had removed its route (the property was missing); with the route back, the test runs. The other five overrides only call super and came with "Enable concurrent testing in camel-spring-xml" (2021). The MLLP overrides date from 2018, before the JUnit 5 migration of camel-mllp (2020); JUnit 4 ran them through the inherited `@Test` method. The `@Disabled` overrides in `SpringLoopDoWhileTest` and `SpringXmlRouteBuilderTest` are not touched. Are there more? I scanned all 14,320 test sources on main (`d175af57c21d`) for a method with `@Override` whose name is a test method (`@Test`, `@ParameterizedTest`, `@RepeatedTest`, `@TestFactory` or `@TestTemplate`, abstract ones included) of a super class or implemented interface (followed through the test sources by simple name), and which has none of these annotations and no `@Disabled`/`@EnabledIf...`/`@DisabledIf...` itself. It finds exactly the 13 methods this PR changes (the 6 `SpringSamplingThrottlerTest` and the 7 MLLP overrides), and none on this branch. Not covered by the scan: test methods inherited from a base class that is not in the repository (a dependency jar). Tests: `SpringSamplingThrottlerTest` 7/7 (six runs, one of them with the whole processor package) and the MLLP class 15/15 pass. Whole modules: camel-spring-xml 1174 tests and camel-mllp 357 tests, 0 failures, 0 errors (26 and 3 skipped). # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. (Test-only change; I built and tested the two modules, including the formatter and import-sort plugins.) # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. This PR was prepared with Claude Code (Claude Opus 5.5). The commit carries a `Co-Authored-By` trailer. _Claude Code on behalf of allthingssecurity_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
