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/28 09:24:49 UTC

[camel] branch main updated: (chores) fixed missing assertions in test code (#6002)

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 7a43633  (chores) fixed missing assertions in test code (#6002)
7a43633 is described below

commit 7a43633b3c3587d949724f580ad0015a6f65ef82
Author: Otavio Rodolfo Piske <or...@users.noreply.github.com>
AuthorDate: Sat Aug 28 11:23:48 2021 +0200

    (chores) fixed missing assertions in test code (#6002)
    
    components: camel-bindy, camel-facebook, camel-grok, camel-http,
    camel-jetty, camel-jooq, camel-jt400, camel-kafka, camel-leveldb,
    camel-leveldb-legacy, camel-microprofile, camel-milo
---
 .../format/factories/BigDecimalFormatFactoryTest.java  |  6 ------
 .../facebook/data/FacebookMethodsTypeHelperTest.java   |  5 -----
 .../apache/camel/component/grok/GrokPatternsTest.java  |  6 ++++--
 .../component/http/HttpInvalidConfigurationTest.java   |  8 +++++---
 .../http/HttpInvalidHttpClientConfigurationTest.java   | 10 ++++++----
 .../component/jetty/HttpProducerJMXBeansIssueTest.java |  6 ++++--
 .../org/apache/camel/component/jooq/JooqXMLTest.java   | 18 ++++++++++++++----
 .../component/jt400/Jt400DataQueueConsumerTest.java    |  7 ++++---
 .../camel/component/kafka/KafkaConsumerTest.java       |  4 +++-
 .../camel/component/leveldb/LevelDBSetupTest.java      | 12 +++++++-----
 .../camel/component/leveldb/LevelDBSetupTest.java      | 12 +++++++-----
 .../metrics/MicroProfileMetricsHelperTest.java         |  4 +++-
 .../camel/component/milo/server/ServerLocalTest.java   | 13 +++++++------
 .../milo/server/ServerSetSecurityPoliciesTest.java     |  9 ++++++---
 14 files changed, 70 insertions(+), 50 deletions(-)

diff --git a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/format/factories/BigDecimalFormatFactoryTest.java b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/format/factories/BigDecimalFormatFactoryTest.java
index 0712429..a7d6644 100644
--- a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/format/factories/BigDecimalFormatFactoryTest.java
+++ b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/format/factories/BigDecimalFormatFactoryTest.java
@@ -40,10 +40,4 @@ public class BigDecimalFormatFactoryTest {
         assertThat(new BigDecimalFormatFactory().canBuild(wrongClass), is(false));
         assertThat(new BigDecimalFormatFactory().canBuild(hasPattern), is(false));
     }
-
-    @Test
-    public void build() throws Exception {
-
-    }
-
 }
diff --git a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelperTest.java b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelperTest.java
index 8056700..c87f4f5 100644
--- a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelperTest.java
+++ b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelperTest.java
@@ -72,11 +72,6 @@ public class FacebookMethodsTypeHelperTest {
     }
 
     @Test
-    public void testfiltermethods() throws Exception {
-        // TODO
-    }
-
-    @Test
     public void testGetArguments() throws Exception {
         final Class<?>[] interfaces = Facebook.class.getInterfaces();
         for (Class<?> clazz : interfaces) {
diff --git a/components/camel-grok/src/test/java/org/apache/camel/component/grok/GrokPatternsTest.java b/components/camel-grok/src/test/java/org/apache/camel/component/grok/GrokPatternsTest.java
index 265c9bc..6d06655 100644
--- a/components/camel-grok/src/test/java/org/apache/camel/component/grok/GrokPatternsTest.java
+++ b/components/camel-grok/src/test/java/org/apache/camel/component/grok/GrokPatternsTest.java
@@ -32,6 +32,7 @@ import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.Arguments;
 import org.junit.jupiter.params.provider.MethodSource;
 
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 @TestInstance(TestInstance.Lifecycle.PER_METHOD)
@@ -82,8 +83,9 @@ public class GrokPatternsTest extends CamelTestSupport {
                         .unmarshal().grok(pattern);
             }
         });
-        expectedOutputTest.accept(
-                template.requestBody("direct:input", input, Map.class));
+
+        assertDoesNotThrow(() -> expectedOutputTest.accept(
+                template.requestBody("direct:input", input, Map.class)));
     }
 
     private static Consumer<Map> test(String key, Object value) {
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpInvalidConfigurationTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpInvalidConfigurationTest.java
index fc97475..6f89cfa 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpInvalidConfigurationTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpInvalidConfigurationTest.java
@@ -34,6 +34,8 @@ import static org.junit.jupiter.api.Assertions.fail;
  */
 public class HttpInvalidConfigurationTest extends CamelTestSupport {
 
+    private FailedToCreateRouteException exception;
+
     @BeforeEach
     @Override
     public void setUp() throws Exception {
@@ -41,14 +43,14 @@ public class HttpInvalidConfigurationTest extends CamelTestSupport {
             super.setUp();
             fail("Should have thrown ResolveEndpointFailedException");
         } catch (FailedToCreateRouteException e) {
-            ResolveEndpointFailedException cause = assertIsInstanceOf(ResolveEndpointFailedException.class, e.getCause());
-            assertTrue(cause.getMessage().endsWith("You have duplicated the http(s) protocol."));
+            exception = e;
         }
     }
 
     @Test
     public void testInvalidHostConfiguration() {
-        // dummy
+        ResolveEndpointFailedException cause = assertIsInstanceOf(ResolveEndpointFailedException.class, exception.getCause());
+        assertTrue(cause.getMessage().endsWith("You have duplicated the http(s) protocol."));
     }
 
     @Override
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpInvalidHttpClientConfigurationTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpInvalidHttpClientConfigurationTest.java
index 4d657b6..c3d072f 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpInvalidHttpClientConfigurationTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpInvalidHttpClientConfigurationTest.java
@@ -34,6 +34,8 @@ import static org.junit.jupiter.api.Assertions.fail;
  */
 public class HttpInvalidHttpClientConfigurationTest extends CamelTestSupport {
 
+    private FailedToCreateRouteException exception;
+
     @BeforeEach
     @Override
     public void setUp() throws Exception {
@@ -41,14 +43,14 @@ public class HttpInvalidHttpClientConfigurationTest extends CamelTestSupport {
             super.setUp();
             fail("Should have thrown ResolveEndpointFailedException");
         } catch (FailedToCreateRouteException e) {
-            ResolveEndpointFailedException cause = assertIsInstanceOf(ResolveEndpointFailedException.class, e.getCause());
-            assertTrue(cause.getMessage().endsWith("Unknown parameters=[{xxx=true}]"));
+            exception = e;
         }
     }
 
     @Test
-    public void testInvalidHostConfiguration() throws Exception {
-        // dummy
+    public void testInvalidHostConfiguration() {
+        ResolveEndpointFailedException cause = assertIsInstanceOf(ResolveEndpointFailedException.class, exception.getCause());
+        assertTrue(cause.getMessage().endsWith("Unknown parameters=[{xxx=true}]"));
     }
 
     @Override
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerJMXBeansIssueTest.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerJMXBeansIssueTest.java
index c0b04d8..ef33858 100644
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerJMXBeansIssueTest.java
+++ b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpProducerJMXBeansIssueTest.java
@@ -22,6 +22,7 @@ import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.builder.RouteBuilder;
 import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -56,12 +57,13 @@ public class HttpProducerJMXBeansIssueTest extends BaseJettyTest {
     }
 
     @Test
+    @Disabled("disabled as this is a manual test")
     public void testNothing() {
         // do nothing as this test is manual
     }
 
-    // @Test
-    // TODO: disabled as this is a manual test
+    @Test
+    @Disabled("disabled as this is a manual test")
     public void testSendAlot() throws Exception {
         Endpoint ep = context.getEndpoint("direct:leak");
         Producer p = ep.createProducer();
diff --git a/components/camel-jooq/src/test/java/org/apache/camel/component/jooq/JooqXMLTest.java b/components/camel-jooq/src/test/java/org/apache/camel/component/jooq/JooqXMLTest.java
index fae13c1..cf8a974 100644
--- a/components/camel-jooq/src/test/java/org/apache/camel/component/jooq/JooqXMLTest.java
+++ b/components/camel-jooq/src/test/java/org/apache/camel/component/jooq/JooqXMLTest.java
@@ -17,6 +17,7 @@
 package org.apache.camel.component.jooq;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.ProducerTemplate;
 import org.jooq.UpdatableRecord;
@@ -24,6 +25,7 @@ import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.test.context.ContextConfiguration;
 
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 /**
@@ -46,24 +48,32 @@ public class JooqXMLTest extends BaseJooqTest {
     @Test
     public void testExecute() {
         ProducerTemplate producerTemplate = context.createProducerTemplate();
-        producerTemplate.sendBody(context.getEndpoint("direct:execute"), ExchangePattern.InOut, "empty");
+        Endpoint ep = context.getEndpoint("direct:execute");
+
+        assertDoesNotThrow(() -> producerTemplate.sendBody(ep, ExchangePattern.InOut, "empty"));
     }
 
     @Test
     public void testFetch() {
         ProducerTemplate producerTemplate = context.createProducerTemplate();
-        producerTemplate.sendBody(context.getEndpoint("direct:fetch"), ExchangePattern.InOut, "empty");
+
+        Endpoint ep = context.getEndpoint("direct:fetch");
+        assertDoesNotThrow(() -> producerTemplate.sendBody(ep, ExchangePattern.InOut, "empty"));
     }
 
     @Test
     public void testSQLSelect() {
         ProducerTemplate producerTemplate = context.createProducerTemplate();
-        producerTemplate.sendBody(context.getEndpoint("direct:sql-select"), ExchangePattern.InOut, "empty");
+
+        Endpoint ep = context.getEndpoint("direct:sql-select");
+        assertDoesNotThrow(() -> producerTemplate.sendBody(ep, ExchangePattern.InOut, "empty"));
     }
 
     @Test
     public void testSQLDelete() {
         ProducerTemplate producerTemplate = context.createProducerTemplate();
-        producerTemplate.sendBody(context.getEndpoint("direct:sql-delete"), ExchangePattern.InOut, "empty");
+
+        Endpoint ep = context.getEndpoint("direct:sql-delete");
+        assertDoesNotThrow(() -> producerTemplate.sendBody(ep, ExchangePattern.InOut, "empty"));
     }
 }
diff --git a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400DataQueueConsumerTest.java b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400DataQueueConsumerTest.java
index 3ae5aa4..2ff7cb1 100644
--- a/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400DataQueueConsumerTest.java
+++ b/components/camel-jt400/src/test/java/org/apache/camel/component/jt400/Jt400DataQueueConsumerTest.java
@@ -17,8 +17,8 @@
 package org.apache.camel.component.jt400;
 
 import java.io.InputStream;
+import java.time.Duration;
 import java.util.Properties;
-import java.util.concurrent.TimeUnit;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.impl.DefaultCamelContext;
@@ -27,6 +27,7 @@ import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Timeout;
 
+import static org.junit.jupiter.api.Assertions.assertTimeout;
 import static org.junit.jupiter.api.Assertions.fail;
 
 /**
@@ -88,9 +89,9 @@ public class Jt400DataQueueConsumerTest {
      * Tests whether <code>receive(long)</code> honours the <code>timeout</code> parameter.
      */
     @Test
-    @Timeout(value = TIMEOUT_VALUE + TIMEOUT_TOLERANCE, unit = TimeUnit.MILLISECONDS)
     public void testReceiveLong() {
-        consumer.receive(TIMEOUT_VALUE);
+        assertTimeout(Duration.ofMillis(TIMEOUT_VALUE + TIMEOUT_TOLERANCE),
+                () -> consumer.receive(TIMEOUT_VALUE));
     }
 
     /**
diff --git a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaConsumerTest.java b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaConsumerTest.java
index d523240..7171264 100644
--- a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaConsumerTest.java
+++ b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/KafkaConsumerTest.java
@@ -21,6 +21,7 @@ import org.apache.camel.Processor;
 import org.apache.camel.spi.ExchangeFactory;
 import org.junit.jupiter.api.Test;
 
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
@@ -62,6 +63,7 @@ public class KafkaConsumerTest {
         when(endpoint.getComponent()).thenReturn(component);
         when(endpoint.getConfiguration()).thenReturn(configuration);
         when(endpoint.getConfiguration().getBrokers()).thenReturn("localhost:2181");
-        new KafkaConsumer(endpoint, processor);
+
+        assertDoesNotThrow(() -> new KafkaConsumer(endpoint, processor));
     }
 }
diff --git a/components/camel-leveldb-legacy/src/test/java/org/apache/camel/component/leveldb/LevelDBSetupTest.java b/components/camel-leveldb-legacy/src/test/java/org/apache/camel/component/leveldb/LevelDBSetupTest.java
index e7e8ed7..45399d9 100644
--- a/components/camel-leveldb-legacy/src/test/java/org/apache/camel/component/leveldb/LevelDBSetupTest.java
+++ b/components/camel-leveldb-legacy/src/test/java/org/apache/camel/component/leveldb/LevelDBSetupTest.java
@@ -18,6 +18,7 @@
 package org.apache.camel.component.leveldb;
 
 import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.condition.DisabledOnOs;
 import org.junit.jupiter.api.condition.OS;
@@ -47,8 +48,12 @@ public class LevelDBSetupTest extends CamelTestSupport {
      */
     @Test
     public void testLevelDBStartWithNoPath() {
+        Assertions.assertDoesNotThrow(() -> runTest("leveldb.dat"));
+    }
+
+    private void runTest(String fileName) {
         levelDBFile = new LevelDBFile();
-        levelDBFile.setFileName("leveldb.dat");
+        levelDBFile.setFileName(fileName);
         levelDBFile.start();
         levelDBFile.stop();
     }
@@ -59,9 +64,6 @@ public class LevelDBSetupTest extends CamelTestSupport {
     @Test
     public void testLevelDBStartWithPath() {
         deleteDirectory("target/data");
-        levelDBFile = new LevelDBFile();
-        levelDBFile.setFileName("target/data/leveldb.dat");
-        levelDBFile.start();
-        levelDBFile.stop();
+        Assertions.assertDoesNotThrow(() -> runTest("target/data/leveldb.dat"));
     }
 }
diff --git a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBSetupTest.java b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBSetupTest.java
index e7e8ed7..45399d9 100644
--- a/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBSetupTest.java
+++ b/components/camel-leveldb/src/test/java/org/apache/camel/component/leveldb/LevelDBSetupTest.java
@@ -18,6 +18,7 @@
 package org.apache.camel.component.leveldb;
 
 import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.condition.DisabledOnOs;
 import org.junit.jupiter.api.condition.OS;
@@ -47,8 +48,12 @@ public class LevelDBSetupTest extends CamelTestSupport {
      */
     @Test
     public void testLevelDBStartWithNoPath() {
+        Assertions.assertDoesNotThrow(() -> runTest("leveldb.dat"));
+    }
+
+    private void runTest(String fileName) {
         levelDBFile = new LevelDBFile();
-        levelDBFile.setFileName("leveldb.dat");
+        levelDBFile.setFileName(fileName);
         levelDBFile.start();
         levelDBFile.stop();
     }
@@ -59,9 +64,6 @@ public class LevelDBSetupTest extends CamelTestSupport {
     @Test
     public void testLevelDBStartWithPath() {
         deleteDirectory("target/data");
-        levelDBFile = new LevelDBFile();
-        levelDBFile.setFileName("target/data/leveldb.dat");
-        levelDBFile.start();
-        levelDBFile.stop();
+        Assertions.assertDoesNotThrow(() -> runTest("target/data/leveldb.dat"));
     }
 }
diff --git a/components/camel-microprofile/camel-microprofile-metrics/src/test/java/org/apache/camel/component/microprofile/metrics/MicroProfileMetricsHelperTest.java b/components/camel-microprofile/camel-microprofile-metrics/src/test/java/org/apache/camel/component/microprofile/metrics/MicroProfileMetricsHelperTest.java
index d08745a..fee0c84 100644
--- a/components/camel-microprofile/camel-microprofile-metrics/src/test/java/org/apache/camel/component/microprofile/metrics/MicroProfileMetricsHelperTest.java
+++ b/components/camel-microprofile/camel-microprofile-metrics/src/test/java/org/apache/camel/component/microprofile/metrics/MicroProfileMetricsHelperTest.java
@@ -23,6 +23,7 @@ import org.eclipse.microprofile.metrics.MetricRegistry;
 import org.eclipse.microprofile.metrics.Tag;
 import org.junit.jupiter.api.Test;
 
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
@@ -68,7 +69,8 @@ public class MicroProfileMetricsHelperTest {
         DefaultCamelContext camelContext = new DefaultCamelContext();
         Registry registry = camelContext.getRegistry();
         registry.bind(MicroProfileMetricsConstants.METRIC_REGISTRY_NAME, MetricRegistries.get(MetricRegistry.Type.APPLICATION));
-        MicroProfileMetricsHelper.getMetricRegistry(camelContext);
+
+        assertDoesNotThrow(() -> MicroProfileMetricsHelper.getMetricRegistry(camelContext));
     }
 
     @Test
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java
index 42738d3..e358f4f 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerLocalTest.java
@@ -26,6 +26,7 @@ import org.apache.camel.test.AvailablePortFinder;
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
 import org.eclipse.milo.opcua.stack.core.types.builtin.Variant;
+import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
@@ -63,31 +64,31 @@ public class ServerLocalTest extends CamelTestSupport {
 
     @Test
     public void testAcceptVariantString() {
-        sendBody(MILO_ITEM_1, new Variant("Foo"));
+        Assertions.assertDoesNotThrow(() -> sendBody(MILO_ITEM_1, new Variant("Foo")));
     }
 
     @Test
     public void testAcceptVariantDouble() {
-        sendBody(MILO_ITEM_1, new Variant(0.0));
+        Assertions.assertDoesNotThrow(() -> sendBody(MILO_ITEM_1, new Variant(0.0)));
     }
 
     @Test
     public void testAcceptString() {
-        sendBody(MILO_ITEM_1, "Foo");
+        Assertions.assertDoesNotThrow(() -> sendBody(MILO_ITEM_1, "Foo"));
     }
 
     @Test
     public void testAcceptDouble() {
-        sendBody(MILO_ITEM_1, 0.0);
+        Assertions.assertDoesNotThrow(() -> sendBody(MILO_ITEM_1, 0.0));
     }
 
     @Test
     public void testAcceptDataValueString() {
-        sendBody(MILO_ITEM_1, new DataValue(new Variant("Foo")));
+        Assertions.assertDoesNotThrow(() -> sendBody(MILO_ITEM_1, new DataValue(new Variant("Foo"))));
     }
 
     @Test
     public void testAcceptDataValueDouble() {
-        sendBody(MILO_ITEM_1, new DataValue(new Variant(0.0)));
+        Assertions.assertDoesNotThrow(() -> sendBody(MILO_ITEM_1, new DataValue(new Variant(0.0))));
     }
 }
diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java
index ccb550d..c28ca63 100644
--- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java
+++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/server/ServerSetSecurityPoliciesTest.java
@@ -17,6 +17,7 @@
 package org.apache.camel.component.milo.server;
 
 import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 
 /**
@@ -27,19 +28,21 @@ public class ServerSetSecurityPoliciesTest extends CamelTestSupport {
     @Test
     public void testSetSecurityPolicies1() {
         final MiloServerComponent component = new MiloServerComponent();
-        component.setSecurityPoliciesById("None");
+        Assertions.assertDoesNotThrow(() -> component.setSecurityPoliciesById("None"));
     }
 
     @Test
     public void testSetSecurityPolicies2() {
         final MiloServerComponent component = new MiloServerComponent();
-        component.setSecurityPoliciesById("http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256");
+        Assertions.assertDoesNotThrow(
+                () -> component.setSecurityPoliciesById("http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256"));
     }
 
     @Test
     public void testSetSecurityPolicies3() {
         final MiloServerComponent component = new MiloServerComponent();
-        component.setSecurityPoliciesById("None,http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256");
+        Assertions.assertDoesNotThrow(
+                () -> component.setSecurityPoliciesById("None,http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256"));
     }
 
 }