This is an automated email from the ASF dual-hosted git repository.
apupier 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 ab3977cbfe83 CAMEL-24989: camel-spring-xml, camel-mllp - Run the
overridden tests that lacked @Test
ab3977cbfe83 is described below
commit ab3977cbfe839d4b592027aa1a732994de8d9886
Author: smjain <[email protected]>
AuthorDate: Tue Oct 6 06:56:46 2026 +0530
CAMEL-24989: camel-spring-xml, camel-mllp - Run the overridden tests that
lacked @Test
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.
SpringSamplingThrottlerTest: the six overrides only called super, so they
are removed
and the inherited tests run. The routes they need are in
samplingThrottler.xml, except
direct:sample-placeholder, which is added with its sample.period property
(the Spring
routes are created before the override properties of the test are applied).
MllpTcpServerConsumerOptionalEndOfDataWithoutValidationTest: the seven
overrides with
their own expectations get @Test, like the sibling classes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
...umerOptionalEndOfDataWithoutValidationTest.java | 7 +++++
.../processor/SpringSamplingThrottlerTest.java | 34 ----------------------
.../spring/processor/samplingThrottler.properties | 18 ++++++++++++
.../camel/spring/processor/samplingThrottler.xml | 6 ++++
4 files changed, 31 insertions(+), 34 deletions(-)
diff --git
a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpServerConsumerOptionalEndOfDataWithoutValidationTest.java
b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpServerConsumerOptionalEndOfDataWithoutValidationTest.java
index 2f3d3256d916..7de4e90ced81 100644
---
a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpServerConsumerOptionalEndOfDataWithoutValidationTest.java
+++
b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpServerConsumerOptionalEndOfDataWithoutValidationTest.java
@@ -39,6 +39,7 @@ public class
MllpTcpServerConsumerOptionalEndOfDataWithoutValidationTest
}
@Override
+ @Test
public void testInvalidMessage() throws Exception {
expectedCompleteCount = 1;
@@ -46,11 +47,13 @@ public class
MllpTcpServerConsumerOptionalEndOfDataWithoutValidationTest
}
@Override
+ @Test
public void testNthInvalidMessage() throws Exception {
runNthInvalidMessage();
}
@Override
+ @Test
public void testMessageContainingEmbeddedStartOfBlock() throws Exception {
expectedCompleteCount = 1;
@@ -58,11 +61,13 @@ public class
MllpTcpServerConsumerOptionalEndOfDataWithoutValidationTest
}
@Override
+ @Test
public void testNthMessageContainingEmbeddedStartOfBlock() throws
Exception {
runNthMessageContainingEmbeddedStartOfBlock();
}
@Override
+ @Test
public void testMessageContainingEmbeddedEndOfBlock() {
expectedCompleteCount = 1;
@@ -77,11 +82,13 @@ public class
MllpTcpServerConsumerOptionalEndOfDataWithoutValidationTest
}
@Override
+ @Test
public void testNthMessageContainingEmbeddedEndOfBlock() throws Exception {
runNthMessageContainingEmbeddedEndOfBlock();
}
@Override
+ @Test
public void testInvalidMessageContainingEmbeddedEndOfBlock() throws
Exception {
runInvalidMessageContainingEmbeddedEndOfBlock();
}
diff --git
a/components/camel-spring-parent/camel-spring-xml/src/test/java/org/apache/camel/spring/processor/SpringSamplingThrottlerTest.java
b/components/camel-spring-parent/camel-spring-xml/src/test/java/org/apache/camel/spring/processor/SpringSamplingThrottlerTest.java
index 2489034351be..aba07bec81d2 100644
---
a/components/camel-spring-parent/camel-spring-xml/src/test/java/org/apache/camel/spring/processor/SpringSamplingThrottlerTest.java
+++
b/components/camel-spring-parent/camel-spring-xml/src/test/java/org/apache/camel/spring/processor/SpringSamplingThrottlerTest.java
@@ -27,38 +27,4 @@ public class SpringSamplingThrottlerTest extends
SamplingThrottlerTest {
protected CamelContext createCamelContext() throws Exception {
return createSpringCamelContext(this,
"org/apache/camel/spring/processor/samplingThrottler.xml");
}
-
- @Override
- public void testSamplingFromExchangeStream() throws Exception {
- try {
- super.testSamplingFromExchangeStream();
- } catch (Exception e) {
- throw new Exception("Error", e);
- }
- }
-
- @Override
- public void testBurstySampling() throws Exception {
- super.testBurstySampling();
- }
-
- @Override
- public void testSendLotsOfMessagesSimultaneouslyButOnly3GetThrough()
throws Exception {
- super.testSendLotsOfMessagesSimultaneouslyButOnly3GetThrough();
- }
-
- @Override
- public void testSamplingWithPropertyPlaceholder() throws Exception {
- super.testSamplingWithPropertyPlaceholder();
- }
-
- @Override
- public void testSamplingUsingMessageFrequency() throws Exception {
- super.testSamplingUsingMessageFrequency();
- }
-
- @Override
- public void testSamplingUsingMessageFrequencyViaDSL() throws Exception {
- super.testSamplingUsingMessageFrequencyViaDSL();
- }
}
diff --git
a/components/camel-spring-parent/camel-spring-xml/src/test/resources/org/apache/camel/spring/processor/samplingThrottler.properties
b/components/camel-spring-parent/camel-spring-xml/src/test/resources/org/apache/camel/spring/processor/samplingThrottler.properties
new file mode 100644
index 000000000000..5b03be8bac64
--- /dev/null
+++
b/components/camel-spring-parent/camel-spring-xml/src/test/resources/org/apache/camel/spring/processor/samplingThrottler.properties
@@ -0,0 +1,18 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+sample.period=1000
diff --git
a/components/camel-spring-parent/camel-spring-xml/src/test/resources/org/apache/camel/spring/processor/samplingThrottler.xml
b/components/camel-spring-parent/camel-spring-xml/src/test/resources/org/apache/camel/spring/processor/samplingThrottler.xml
index 23d9e014a7a1..f9e480185287 100644
---
a/components/camel-spring-parent/camel-spring-xml/src/test/resources/org/apache/camel/spring/processor/samplingThrottler.xml
+++
b/components/camel-spring-parent/camel-spring-xml/src/test/resources/org/apache/camel/spring/processor/samplingThrottler.xml
@@ -24,6 +24,7 @@
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
">
<camelContext xmlns="http://camel.apache.org/schema/spring">
+ <propertyPlaceholder id="properties"
location="classpath:org/apache/camel/spring/processor/samplingThrottler.properties"/>
<jmxAgent id="jmx" disabled="true"/>
<!-- START SNIPPET: e1 -->
<route>
@@ -47,6 +48,11 @@
<sample samplePeriod="3153600000000"/>
<to uri="mock:result"/>
</route>
+ <route>
+ <from uri="direct:sample-placeholder"/>
+ <sample samplePeriod="{{sample.period}}"/>
+ <to uri="mock:result"/>
+ </route>
<!-- END SNIPPET: e1 -->
</camelContext>