You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2024/01/08 08:53:35 UTC
(camel) branch main updated: (chores) camel-mllp: minor cleanups (#12694)
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.git
The following commit(s) were added to refs/heads/main by this push:
new 98497d765e0 (chores) camel-mllp: minor cleanups (#12694)
98497d765e0 is described below
commit 98497d765e0d9787ae110fbf23b4f7527659cc4f
Author: Otavio Rodolfo Piske <or...@users.noreply.github.com>
AuthorDate: Mon Jan 8 09:53:29 2024 +0100
(chores) camel-mllp: minor cleanups (#12694)
- Removed commented code
- Removed usage of deprecated methods
- Use lambdas
---
...pServerConsumerOptionalEndOfDataWithValidationTest.java | 14 +++++++-------
...TcpServerConsumerEndOfDataAndValidationTestSupport.java | 10 ----------
2 files changed, 7 insertions(+), 17 deletions(-)
diff --git a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpServerConsumerOptionalEndOfDataWithValidationTest.java b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpServerConsumerOptionalEndOfDataWithValidationTest.java
index 0e15159b447..7cb3e2e96e7 100644
--- a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpServerConsumerOptionalEndOfDataWithValidationTest.java
+++ b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpServerConsumerOptionalEndOfDataWithValidationTest.java
@@ -43,7 +43,7 @@ public class MllpTcpServerConsumerOptionalEndOfDataWithValidationTest
public void testInvalidMessage() {
expectedInvalidCount = 1;
- assertDoesNotThrow(() -> runInvalidMessage());
+ assertDoesNotThrow(this::runInvalidMessage);
}
@Override
@@ -51,7 +51,7 @@ public class MllpTcpServerConsumerOptionalEndOfDataWithValidationTest
public void testNthInvalidMessage() {
expectedInvalidCount = 1;
- assertDoesNotThrow(() -> runNthInvalidMessage());
+ assertDoesNotThrow(this::runNthInvalidMessage);
}
@Override
@@ -59,7 +59,7 @@ public class MllpTcpServerConsumerOptionalEndOfDataWithValidationTest
public void testMessageContainingEmbeddedStartOfBlock() {
expectedInvalidCount = 1;
- assertDoesNotThrow(() -> runMessageContainingEmbeddedStartOfBlock());
+ assertDoesNotThrow(this::runMessageContainingEmbeddedStartOfBlock);
}
@Override
@@ -67,7 +67,7 @@ public class MllpTcpServerConsumerOptionalEndOfDataWithValidationTest
public void testNthMessageContainingEmbeddedStartOfBlock() {
expectedInvalidCount = 1;
- assertDoesNotThrow(() -> runNthMessageContainingEmbeddedStartOfBlock());
+ assertDoesNotThrow(this::runNthMessageContainingEmbeddedStartOfBlock);
}
@Override
@@ -90,7 +90,7 @@ public class MllpTcpServerConsumerOptionalEndOfDataWithValidationTest
public void testInvalidMessageContainingEmbeddedEndOfBlock() {
expectedInvalidCount = 1;
- assertDoesNotThrow(() -> runInvalidMessageContainingEmbeddedEndOfBlock());
+ assertDoesNotThrow(this::runInvalidMessageContainingEmbeddedEndOfBlock);
}
@Override
@@ -98,7 +98,7 @@ public class MllpTcpServerConsumerOptionalEndOfDataWithValidationTest
public void testNthMessageContainingEmbeddedEndOfBlock() {
expectedInvalidCount = 1;
- assertDoesNotThrow(() -> runNthMessageContainingEmbeddedEndOfBlock());
+ assertDoesNotThrow(this::runNthMessageContainingEmbeddedEndOfBlock);
}
@Override
@@ -106,6 +106,6 @@ public class MllpTcpServerConsumerOptionalEndOfDataWithValidationTest
public void testMessageWithoutEndOfDataByte() {
expectedCompleteCount = 1;
- assertDoesNotThrow(() -> runMessageWithoutEndOfDataByte());
+ assertDoesNotThrow(this::runMessageWithoutEndOfDataByte);
}
}
diff --git a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/TcpServerConsumerEndOfDataAndValidationTestSupport.java b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/TcpServerConsumerEndOfDataAndValidationTestSupport.java
index 98b68a0432d..9954f640d14 100644
--- a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/TcpServerConsumerEndOfDataAndValidationTestSupport.java
+++ b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/TcpServerConsumerEndOfDataAndValidationTestSupport.java
@@ -74,7 +74,6 @@ public abstract class TcpServerConsumerEndOfDataAndValidationTestSupport extends
DefaultCamelContext context = (DefaultCamelContext) super.createCamelContext();
context.setUseMDCLogging(true);
- context.setName(this.getClass().getSimpleName());
return context;
}
@@ -369,15 +368,6 @@ public abstract class TcpServerConsumerEndOfDataAndValidationTestSupport extends
assertTrue(invalidMessageDone.matches(5, TimeUnit.SECONDS),
"Exchange containing invalid message should have completed");
// The component may reset the connection in this case, so reconnect if needed
- /*
- // TODO: Figure out why this isn't working
- try {
- mllpClient.checkConnection();
- } catch (MllpJUnitResourceException checkConnectionEx) {
- mllpClient.disconnect();
- mllpClient.connect();
- }
- */
mllpClient.disconnect();
mllpClient.connect();
} else {