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 2021/08/27 10:49:45 UTC
[camel] branch main updated: (chores) camel-mllp: test code cleanup
(#6001)
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 7bd08b2 (chores) camel-mllp: test code cleanup (#6001)
7bd08b2 is described below
commit 7bd08b2044cb7a6e3d3396b3a62c6cc404736592
Author: Otavio Rodolfo Piske <or...@users.noreply.github.com>
AuthorDate: Fri Aug 27 12:49:22 2021 +0200
(chores) camel-mllp: test code cleanup (#6001)
- Removed invalid JUnit 4 dependency
- Ensure tests have at least one assertion
- Removed unused exceptions
---
components/camel-mllp/pom.xml | 6 ----
...roducerOptionalEndOfDataWithValidationTest.java | 34 +++++++++++----------
...ucerOptionalEndOfDataWithoutValidationTest.java | 34 +++++++++++----------
...roducerRequiredEndOfDataWithValidationTest.java | 34 +++++++++++----------
...ucerRequiredEndOfDataWithoutValidationTest.java | 32 ++++++++++----------
...onsumerOptionalEndOfDataWithValidationTest.java | 31 +++++++++----------
...umerOptionalEndOfDataWithoutValidationTest.java | 7 +++--
...onsumerRequiredEndOfDataWithValidationTest.java | 31 +++++++++----------
...umerRequiredEndOfDataWithoutValidationTest.java | 35 +++++++++++-----------
9 files changed, 125 insertions(+), 119 deletions(-)
diff --git a/components/camel-mllp/pom.xml b/components/camel-mllp/pom.xml
index 7bcaaeb..aa55634 100644
--- a/components/camel-mllp/pom.xml
+++ b/components/camel-mllp/pom.xml
@@ -76,12 +76,6 @@
<type>test-jar</type>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
<!-- test logging -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
diff --git a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerOptionalEndOfDataWithValidationTest.java b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerOptionalEndOfDataWithValidationTest.java
index 4e2e107..6c6c663 100644
--- a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerOptionalEndOfDataWithValidationTest.java
+++ b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerOptionalEndOfDataWithValidationTest.java
@@ -18,6 +18,8 @@ package org.apache.camel.component.mllp;
import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+
public class MllpTcpClientProducerOptionalEndOfDataWithValidationTest
extends TcpClientProducerEndOfDataAndValidationTestSupport {
@Override
@@ -32,60 +34,60 @@ public class MllpTcpClientProducerOptionalEndOfDataWithValidationTest
@Override
@Test
- public void testSendSingleMessageWithoutEndOfData() throws Exception {
+ public void testSendSingleMessageWithoutEndOfData() {
expectedAACount = 1;
- runSendSingleMessageWithoutEndOfData();
+ assertDoesNotThrow(() -> runSendSingleMessageWithoutEndOfData());
}
@Override
@Test
- public void testSendMultipleMessagesWithoutEndOfDataByte() throws Exception {
- runSendMultipleMessagesWithoutEndOfDataByte(aa);
+ public void testSendMultipleMessagesWithoutEndOfDataByte() {
+ assertDoesNotThrow(() -> runSendMultipleMessagesWithoutEndOfDataByte(aa));
}
@Override
@Test
- public void testEmptyAcknowledgement() throws Exception {
- runEmptyAcknowledgement(invalid);
+ public void testEmptyAcknowledgement() {
+ assertDoesNotThrow(() -> runEmptyAcknowledgement(invalid));
}
@Override
@Test
- public void testInvalidAcknowledgement() throws Exception {
- runInvalidAcknowledgement(invalid);
+ public void testInvalidAcknowledgement() {
+ assertDoesNotThrow(() -> runInvalidAcknowledgement(invalid));
}
@Override
@Test
- public void testMissingEndOfDataByte() throws Exception {
+ public void testMissingEndOfDataByte() {
expectedAACount = 3;
- runMissingEndOfDataByte();
+ assertDoesNotThrow(() -> runMissingEndOfDataByte());
}
@Override
@Test
- public void testSendMultipleMessagesWithoutSomeEndOfDataByte() throws Exception {
+ public void testSendMultipleMessagesWithoutSomeEndOfDataByte() {
expectedAACount = 3;
- runSendMultipleMessagesWithoutSomeEndOfDataByte();
+ assertDoesNotThrow(() -> runSendMultipleMessagesWithoutSomeEndOfDataByte());
}
@Override
@Test
- public void testInvalidAcknowledgementContainingEmbeddedStartOfBlock() throws Exception {
+ public void testInvalidAcknowledgementContainingEmbeddedStartOfBlock() {
expectedAACount = 1;
- runInvalidAcknowledgementContainingEmbeddedEndOfBlockByte();
+ assertDoesNotThrow(() -> runInvalidAcknowledgementContainingEmbeddedEndOfBlockByte());
}
@Override
@Test
- public void testInvalidAcknowledgementContainingEmbeddedEndOfBlockByte() throws Exception {
+ public void testInvalidAcknowledgementContainingEmbeddedEndOfBlockByte() {
expectedTimeoutCount = 1;
- runInvalidAcknowledgementContainingEmbeddedEndOfBlockByte();
+ assertDoesNotThrow(() -> runInvalidAcknowledgementContainingEmbeddedEndOfBlockByte());
}
}
diff --git a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerOptionalEndOfDataWithoutValidationTest.java b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerOptionalEndOfDataWithoutValidationTest.java
index da92c85..e25e735 100644
--- a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerOptionalEndOfDataWithoutValidationTest.java
+++ b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerOptionalEndOfDataWithoutValidationTest.java
@@ -18,6 +18,8 @@ package org.apache.camel.component.mllp;
import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+
public class MllpTcpClientProducerOptionalEndOfDataWithoutValidationTest
extends TcpClientProducerEndOfDataAndValidationTestSupport {
@Override
@@ -32,63 +34,63 @@ public class MllpTcpClientProducerOptionalEndOfDataWithoutValidationTest
@Override
@Test
- public void testSendSingleMessageWithoutEndOfData() throws Exception {
+ public void testSendSingleMessageWithoutEndOfData() {
expectedAACount = 1;
- runSendSingleMessageWithoutEndOfData();
+ assertDoesNotThrow(() -> runSendSingleMessageWithoutEndOfData());
}
@Override
@Test
- public void testSendMultipleMessagesWithoutEndOfDataByte() throws Exception {
+ public void testSendMultipleMessagesWithoutEndOfDataByte() {
expectedAACount = 3;
- runSendMultipleMessagesWithoutEndOfDataByte();
+ assertDoesNotThrow(() -> runSendMultipleMessagesWithoutEndOfDataByte());
}
@Override
@Test
- public void testEmptyAcknowledgement() throws Exception {
- runEmptyAcknowledgement(aa);
+ public void testEmptyAcknowledgement() {
+ assertDoesNotThrow(() -> runEmptyAcknowledgement(aa));
}
@Override
@Test
- public void testInvalidAcknowledgement() throws Exception {
- runInvalidAcknowledgement(aa);
+ public void testInvalidAcknowledgement() {
+ assertDoesNotThrow(() -> runInvalidAcknowledgement(aa));
}
@Override
@Test
- public void testMissingEndOfDataByte() throws Exception {
+ public void testMissingEndOfDataByte() {
expectedAACount = 3;
expectedTimeoutCount = 0;
- runMissingEndOfDataByte();
+ assertDoesNotThrow(() -> runMissingEndOfDataByte());
}
@Override
@Test
- public void testInvalidAcknowledgementContainingEmbeddedStartOfBlock() throws Exception {
+ public void testInvalidAcknowledgementContainingEmbeddedStartOfBlock() {
expectedAACount = 1;
- runInvalidAcknowledgementContainingEmbeddedEndOfBlockByte();
+ assertDoesNotThrow(() -> runInvalidAcknowledgementContainingEmbeddedEndOfBlockByte());
}
@Override
@Test
- public void testInvalidAcknowledgementContainingEmbeddedEndOfBlockByte() throws Exception {
+ public void testInvalidAcknowledgementContainingEmbeddedEndOfBlockByte() {
expectedAACount = 1;
- runInvalidAcknowledgementContainingEmbeddedEndOfBlockByte();
+ assertDoesNotThrow(() -> runInvalidAcknowledgementContainingEmbeddedEndOfBlockByte());
}
@Override
@Test
- public void testSendMultipleMessagesWithoutSomeEndOfDataByte() throws Exception {
+ public void testSendMultipleMessagesWithoutSomeEndOfDataByte() {
expectedAACount = 3;
- runSendMultipleMessagesWithoutSomeEndOfDataByte();
+ assertDoesNotThrow(() -> runSendMultipleMessagesWithoutSomeEndOfDataByte());
}
}
diff --git a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerRequiredEndOfDataWithValidationTest.java b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerRequiredEndOfDataWithValidationTest.java
index 8f29263..0fb977c 100644
--- a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerRequiredEndOfDataWithValidationTest.java
+++ b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerRequiredEndOfDataWithValidationTest.java
@@ -18,6 +18,8 @@ package org.apache.camel.component.mllp;
import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+
public class MllpTcpClientProducerRequiredEndOfDataWithValidationTest
extends TcpClientProducerEndOfDataAndValidationTestSupport {
@@ -33,62 +35,62 @@ public class MllpTcpClientProducerRequiredEndOfDataWithValidationTest
@Override
@Test
- public void testSendSingleMessageWithoutEndOfData() throws Exception {
+ public void testSendSingleMessageWithoutEndOfData() {
expectedTimeoutCount = 1;
- runSendSingleMessageWithoutEndOfData();
+ assertDoesNotThrow(() -> runSendSingleMessageWithoutEndOfData());
}
@Override
@Test
- public void testSendMultipleMessagesWithoutEndOfDataByte() throws Exception {
- runSendMultipleMessagesWithoutEndOfDataByte(ackTimeoutError);
+ public void testSendMultipleMessagesWithoutEndOfDataByte() {
+ assertDoesNotThrow(() -> runSendMultipleMessagesWithoutEndOfDataByte(ackTimeoutError));
}
@Override
@Test
- public void testEmptyAcknowledgement() throws Exception {
- runEmptyAcknowledgement(aa);
+ public void testEmptyAcknowledgement() {
+ assertDoesNotThrow(() -> runEmptyAcknowledgement(aa));
}
@Override
@Test
- public void testInvalidAcknowledgement() throws Exception {
- runInvalidAcknowledgement(aa);
+ public void testInvalidAcknowledgement() {
+ assertDoesNotThrow(() -> runInvalidAcknowledgement(aa));
}
@Override
@Test
- public void testMissingEndOfDataByte() throws Exception {
+ public void testMissingEndOfDataByte() {
expectedAACount = 2;
expectedTimeoutCount = 1;
- runMissingEndOfDataByte();
+ assertDoesNotThrow(() -> runMissingEndOfDataByte());
}
@Override
@Test
- public void testInvalidAcknowledgementContainingEmbeddedStartOfBlock() throws Exception {
+ public void testInvalidAcknowledgementContainingEmbeddedStartOfBlock() {
expectedAACount = 1;
- runInvalidAcknowledgementContainingEmbeddedEndOfBlockByte();
+ assertDoesNotThrow(() -> runInvalidAcknowledgementContainingEmbeddedEndOfBlockByte());
}
@Override
@Test
- public void testInvalidAcknowledgementContainingEmbeddedEndOfBlockByte() throws Exception {
+ public void testInvalidAcknowledgementContainingEmbeddedEndOfBlockByte() {
expectedTimeoutCount = 1;
- runInvalidAcknowledgementContainingEmbeddedEndOfBlockByte();
+ assertDoesNotThrow(() -> runInvalidAcknowledgementContainingEmbeddedEndOfBlockByte());
}
@Override
@Test
- public void testSendMultipleMessagesWithoutSomeEndOfDataByte() throws Exception {
+ public void testSendMultipleMessagesWithoutSomeEndOfDataByte() {
expectedAACount = 2;
expectedTimeoutCount = 1;
- runSendMultipleMessagesWithoutSomeEndOfDataByte();
+ assertDoesNotThrow(() -> runSendMultipleMessagesWithoutSomeEndOfDataByte());
}
}
diff --git a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerRequiredEndOfDataWithoutValidationTest.java b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerRequiredEndOfDataWithoutValidationTest.java
index c98eaa7..81ba4f7 100644
--- a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerRequiredEndOfDataWithoutValidationTest.java
+++ b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpClientProducerRequiredEndOfDataWithoutValidationTest.java
@@ -18,6 +18,8 @@ package org.apache.camel.component.mllp;
import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+
public class MllpTcpClientProducerRequiredEndOfDataWithoutValidationTest
extends TcpClientProducerEndOfDataAndValidationTestSupport {
@@ -33,62 +35,62 @@ public class MllpTcpClientProducerRequiredEndOfDataWithoutValidationTest
@Override
@Test
- public void testSendSingleMessageWithoutEndOfData() throws Exception {
+ public void testSendSingleMessageWithoutEndOfData() {
expectedTimeoutCount = 1;
- runSendSingleMessageWithoutEndOfData();
+ assertDoesNotThrow(() -> runSendSingleMessageWithoutEndOfData());
}
@Override
@Test
- public void testSendMultipleMessagesWithoutEndOfDataByte() throws Exception {
+ public void testSendMultipleMessagesWithoutEndOfDataByte() {
expectedTimeoutCount = 3;
}
@Override
@Test
- public void testEmptyAcknowledgement() throws Exception {
- runEmptyAcknowledgement(aa);
+ public void testEmptyAcknowledgement() {
+ assertDoesNotThrow(() -> runEmptyAcknowledgement(aa));
}
@Override
@Test
- public void testInvalidAcknowledgement() throws Exception {
- runInvalidAcknowledgement(aa);
+ public void testInvalidAcknowledgement() {
+ assertDoesNotThrow(() -> runInvalidAcknowledgement(aa));
}
@Override
@Test
- public void testMissingEndOfDataByte() throws Exception {
+ public void testMissingEndOfDataByte() {
expectedAACount = 2;
expectedTimeoutCount = 1;
- runMissingEndOfDataByte();
+ assertDoesNotThrow(() -> runMissingEndOfDataByte());
}
@Override
@Test
- public void testInvalidAcknowledgementContainingEmbeddedStartOfBlock() throws Exception {
+ public void testInvalidAcknowledgementContainingEmbeddedStartOfBlock() {
expectedAACount = 1;
- runInvalidAcknowledgementContainingEmbeddedEndOfBlockByte();
+ assertDoesNotThrow(() -> runInvalidAcknowledgementContainingEmbeddedEndOfBlockByte());
}
@Override
@Test
- public void testInvalidAcknowledgementContainingEmbeddedEndOfBlockByte() throws Exception {
+ public void testInvalidAcknowledgementContainingEmbeddedEndOfBlockByte() {
expectedTimeoutCount = 1;
- runInvalidAcknowledgementContainingEmbeddedEndOfBlockByte();
+ assertDoesNotThrow(() -> runInvalidAcknowledgementContainingEmbeddedEndOfBlockByte());
}
@Override
@Test
- public void testSendMultipleMessagesWithoutSomeEndOfDataByte() throws Exception {
+ public void testSendMultipleMessagesWithoutSomeEndOfDataByte() {
expectedAACount = 2;
expectedTimeoutCount = 1;
- runSendMultipleMessagesWithoutSomeEndOfDataByte();
+ assertDoesNotThrow(() -> runSendMultipleMessagesWithoutSomeEndOfDataByte());
}
}
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 6fdd530..0e15159 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
@@ -22,6 +22,7 @@ import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.test.mllp.Hl7TestMessageGenerator;
import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class MllpTcpServerConsumerOptionalEndOfDataWithValidationTest
@@ -39,39 +40,39 @@ public class MllpTcpServerConsumerOptionalEndOfDataWithValidationTest
@Override
@Test
- public void testInvalidMessage() throws Exception {
+ public void testInvalidMessage() {
expectedInvalidCount = 1;
- runInvalidMessage();
+ assertDoesNotThrow(() -> runInvalidMessage());
}
@Override
@Test
- public void testNthInvalidMessage() throws Exception {
+ public void testNthInvalidMessage() {
expectedInvalidCount = 1;
- runNthInvalidMessage();
+ assertDoesNotThrow(() -> runNthInvalidMessage());
}
@Override
@Test
- public void testMessageContainingEmbeddedStartOfBlock() throws Exception {
+ public void testMessageContainingEmbeddedStartOfBlock() {
expectedInvalidCount = 1;
- runMessageContainingEmbeddedStartOfBlock();
+ assertDoesNotThrow(() -> runMessageContainingEmbeddedStartOfBlock());
}
@Override
@Test
- public void testNthMessageContainingEmbeddedStartOfBlock() throws Exception {
+ public void testNthMessageContainingEmbeddedStartOfBlock() {
expectedInvalidCount = 1;
- runNthMessageContainingEmbeddedStartOfBlock();
+ assertDoesNotThrow(() -> runNthMessageContainingEmbeddedStartOfBlock());
}
@Override
@Test
- public void testMessageContainingEmbeddedEndOfBlock() throws Exception {
+ public void testMessageContainingEmbeddedEndOfBlock() {
expectedInvalidCount = 1;
setExpectedCounts();
@@ -86,25 +87,25 @@ public class MllpTcpServerConsumerOptionalEndOfDataWithValidationTest
@Override
@Test
- public void testInvalidMessageContainingEmbeddedEndOfBlock() throws Exception {
+ public void testInvalidMessageContainingEmbeddedEndOfBlock() {
expectedInvalidCount = 1;
- runInvalidMessageContainingEmbeddedEndOfBlock();
+ assertDoesNotThrow(() -> runInvalidMessageContainingEmbeddedEndOfBlock());
}
@Override
@Test
- public void testNthMessageContainingEmbeddedEndOfBlock() throws Exception {
+ public void testNthMessageContainingEmbeddedEndOfBlock() {
expectedInvalidCount = 1;
- runNthMessageContainingEmbeddedEndOfBlock();
+ assertDoesNotThrow(() -> runNthMessageContainingEmbeddedEndOfBlock());
}
@Override
@Test
- public void testMessageWithoutEndOfDataByte() throws Exception {
+ public void testMessageWithoutEndOfDataByte() {
expectedCompleteCount = 1;
- runMessageWithoutEndOfDataByte();
+ assertDoesNotThrow(() -> runMessageWithoutEndOfDataByte());
}
}
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 42e075d..ed24883 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
@@ -22,6 +22,7 @@ import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.test.mllp.Hl7TestMessageGenerator;
import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class MllpTcpServerConsumerOptionalEndOfDataWithoutValidationTest
@@ -87,14 +88,14 @@ public class MllpTcpServerConsumerOptionalEndOfDataWithoutValidationTest
@Override
@Test
- public void testInitialMessageWithoutEndOfDataByte() throws Exception {
+ public void testInitialMessageWithoutEndOfDataByte() {
expectedCompleteCount = 1;
setExpectedCounts();
mllpClient.setSendEndOfData(false);
- mllpClient.sendFramedData(Hl7TestMessageGenerator.generateMessage());
+ assertDoesNotThrow(() -> mllpClient.sendFramedData(Hl7TestMessageGenerator.generateMessage()));
}
@Override
@@ -108,6 +109,6 @@ public class MllpTcpServerConsumerOptionalEndOfDataWithoutValidationTest
mllpClient.setSendEndOfData(false);
- mllpClient.sendFramedData(Hl7TestMessageGenerator.generateMessage());
+ assertDoesNotThrow(() -> mllpClient.sendFramedData(Hl7TestMessageGenerator.generateMessage()));
}
}
diff --git a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpServerConsumerRequiredEndOfDataWithValidationTest.java b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpServerConsumerRequiredEndOfDataWithValidationTest.java
index 38d708c..a8325b62 100644
--- a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpServerConsumerRequiredEndOfDataWithValidationTest.java
+++ b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpServerConsumerRequiredEndOfDataWithValidationTest.java
@@ -22,6 +22,7 @@ import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.test.mllp.Hl7TestMessageGenerator;
import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertFalse;
public class MllpTcpServerConsumerRequiredEndOfDataWithValidationTest
@@ -39,39 +40,39 @@ public class MllpTcpServerConsumerRequiredEndOfDataWithValidationTest
@Override
@Test
- public void testInvalidMessage() throws Exception {
+ public void testInvalidMessage() {
expectedInvalidCount = 1;
- runNthInvalidMessage();
+ assertDoesNotThrow(() -> runNthInvalidMessage());
}
@Override
@Test
- public void testNthInvalidMessage() throws Exception {
+ public void testNthInvalidMessage() {
expectedInvalidCount = 1;
- runNthInvalidMessage();
+ assertDoesNotThrow(() -> runNthInvalidMessage());
}
@Override
@Test
- public void testMessageContainingEmbeddedStartOfBlock() throws Exception {
+ public void testMessageContainingEmbeddedStartOfBlock() {
expectedInvalidCount = 1;
- runMessageContainingEmbeddedStartOfBlock();
+ assertDoesNotThrow(() -> runMessageContainingEmbeddedStartOfBlock());
}
@Override
@Test
- public void testNthMessageContainingEmbeddedStartOfBlock() throws Exception {
+ public void testNthMessageContainingEmbeddedStartOfBlock() {
expectedInvalidCount = 1;
- runNthMessageContainingEmbeddedStartOfBlock();
+ assertDoesNotThrow(() -> runNthMessageContainingEmbeddedStartOfBlock());
}
@Override
@Test
- public void testMessageContainingEmbeddedEndOfBlock() throws Exception {
+ public void testMessageContainingEmbeddedEndOfBlock() {
//expectedInvalidCount = 1;
setExpectedCounts();
@@ -86,27 +87,27 @@ public class MllpTcpServerConsumerRequiredEndOfDataWithValidationTest
@Override
@Test
- public void testInvalidMessageContainingEmbeddedEndOfBlock() throws Exception {
+ public void testInvalidMessageContainingEmbeddedEndOfBlock() {
expectedInvalidCount = 1;
- runInvalidMessageContainingEmbeddedEndOfBlock();
+ assertDoesNotThrow(() -> runInvalidMessageContainingEmbeddedEndOfBlock());
}
@Override
@Test
- public void testNthMessageContainingEmbeddedEndOfBlock() throws Exception {
+ public void testNthMessageContainingEmbeddedEndOfBlock() {
expectedInvalidCount = 1;
- runNthMessageContainingEmbeddedEndOfBlock();
+ assertDoesNotThrow(() -> runNthMessageContainingEmbeddedEndOfBlock());
}
@Override
@Test
- public void testMessageWithoutEndOfDataByte() throws Exception {
+ public void testMessageWithoutEndOfDataByte() {
expectedCompleteCount = 1;
expectedInvalidCount = 1;
- runMessageWithoutEndOfDataByte();
+ assertDoesNotThrow(() -> runMessageWithoutEndOfDataByte());
}
}
diff --git a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpServerConsumerRequiredEndOfDataWithoutValidationTest.java b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpServerConsumerRequiredEndOfDataWithoutValidationTest.java
index 30d1c90..27d967d 100644
--- a/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpServerConsumerRequiredEndOfDataWithoutValidationTest.java
+++ b/components/camel-mllp/src/test/java/org/apache/camel/component/mllp/MllpTcpServerConsumerRequiredEndOfDataWithoutValidationTest.java
@@ -22,6 +22,7 @@ import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.test.mllp.Hl7TestMessageGenerator;
import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertFalse;
public class MllpTcpServerConsumerRequiredEndOfDataWithoutValidationTest
@@ -39,33 +40,33 @@ public class MllpTcpServerConsumerRequiredEndOfDataWithoutValidationTest
@Override
@Test
- public void testInvalidMessage() throws Exception {
- runNthInvalidMessage();
+ public void testInvalidMessage() {
+ assertDoesNotThrow(() -> runNthInvalidMessage());
}
@Override
@Test
- public void testNthInvalidMessage() throws Exception {
- runNthInvalidMessage();
+ public void testNthInvalidMessage() {
+ assertDoesNotThrow(() -> runNthInvalidMessage());
}
@Override
@Test
- public void testMessageContainingEmbeddedStartOfBlock() throws Exception {
+ public void testMessageContainingEmbeddedStartOfBlock() {
expectedCompleteCount = 1;
- runMessageContainingEmbeddedStartOfBlock();
+ assertDoesNotThrow(() -> runMessageContainingEmbeddedStartOfBlock());
}
@Override
@Test
- public void testNthMessageContainingEmbeddedStartOfBlock() throws Exception {
- runNthMessageContainingEmbeddedStartOfBlock();
+ public void testNthMessageContainingEmbeddedStartOfBlock() {
+ assertDoesNotThrow(() -> runNthMessageContainingEmbeddedStartOfBlock());
}
@Override
@Test
- public void testMessageContainingEmbeddedEndOfBlock() throws Exception {
+ public void testMessageContainingEmbeddedEndOfBlock() {
setExpectedCounts();
NotifyBuilder done = new NotifyBuilder(context()).whenDone(1).create();
@@ -78,36 +79,36 @@ public class MllpTcpServerConsumerRequiredEndOfDataWithoutValidationTest
@Override
@Test
- public void testInvalidMessageContainingEmbeddedEndOfBlock() throws Exception {
+ public void testInvalidMessageContainingEmbeddedEndOfBlock() {
expectedInvalidCount = 1;
- runInvalidMessageContainingEmbeddedEndOfBlock();
+ assertDoesNotThrow(() -> runInvalidMessageContainingEmbeddedEndOfBlock());
}
@Override
@Test
- public void testNthMessageContainingEmbeddedEndOfBlock() throws Exception {
+ public void testNthMessageContainingEmbeddedEndOfBlock() {
expectedInvalidCount = 1;
- runNthMessageContainingEmbeddedEndOfBlock();
+ assertDoesNotThrow(() -> runNthMessageContainingEmbeddedEndOfBlock());
}
@Override
@Test
- public void testInitialMessageWithoutEndOfDataByte() throws Exception {
+ public void testInitialMessageWithoutEndOfDataByte() {
setExpectedCounts();
mllpClient.setSendEndOfData(false);
- mllpClient.sendFramedData(Hl7TestMessageGenerator.generateMessage());
+ assertDoesNotThrow(() -> mllpClient.sendFramedData(Hl7TestMessageGenerator.generateMessage()));
}
@Override
@Test
- public void testMessageWithoutEndOfDataByte() throws Exception {
+ public void testMessageWithoutEndOfDataByte() {
expectedCompleteCount = 1;
expectedInvalidCount = 1;
- runMessageWithoutEndOfDataByte();
+ assertDoesNotThrow(() -> runMessageWithoutEndOfDataByte());
}
}