This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit a1c26018e19ff835ab759ef39e048238b2fe5757
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Fri Jan 3 20:23:42 2025 +0100

    Fixed netty tests
---
 .../apache/camel/component/netty/ObjectSerializationTest.java | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git 
a/components/camel-netty/src/test/java/org/apache/camel/component/netty/ObjectSerializationTest.java
 
b/components/camel-netty/src/test/java/org/apache/camel/component/netty/ObjectSerializationTest.java
index 3abe03faa35..1a251bd7b12 100644
--- 
a/components/camel-netty/src/test/java/org/apache/camel/component/netty/ObjectSerializationTest.java
+++ 
b/components/camel-netty/src/test/java/org/apache/camel/component/netty/ObjectSerializationTest.java
@@ -22,17 +22,18 @@ import java.util.Properties;
 import io.netty.channel.ChannelHandler;
 import io.netty.handler.codec.serialization.ClassResolvers;
 import org.apache.camel.BindToRegistry;
+import org.apache.camel.CamelExecutionException;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.netty.codec.ObjectDecoder;
 import org.apache.camel.component.netty.codec.ObjectEncoder;
 import org.apache.camel.test.AvailablePortFinder;
-import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
 
 /**
  * Object Serialization is not allowed by default. However it can be enabled 
by adding specific encoders/decoders.
@@ -49,8 +50,12 @@ public class ObjectSerializationTest extends BaseNettyTest {
     @Test
     public void testObjectSerializationFailureByDefault() {
         Date date = new Date();
-        Object o = 
template.requestBody("netty:tcp://localhost:{{port}}?sync=true&encoders=#encoder",
 date, Date.class);
-        Assertions.assertNull(o);
+        try {
+            Object o = 
template.requestBody("netty:tcp://localhost:{{port}}?sync=true&encoders=#encoder",
 date, Date.class);
+            fail("Should have thrown exception");
+        } catch (CamelExecutionException e) {
+            // expected
+        }
     }
 
     @Test

Reply via email to