gnodet commented on code in PR #24858:
URL: https://github.com/apache/camel/pull/24858#discussion_r3655164547


##########
components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectNodeTest.java:
##########
@@ -130,8 +131,11 @@ public void shouldCreateNode() {
     }
 
     @Test
-    public void shouldCreateNodeWithoutChildRecords() {
-        new SObjectNode(new SObjectTree(), simpleAccount);
+    void shouldCreateNodeWithoutChildRecords() {
+        SObjectNode node = new SObjectNode(new SObjectTree(), simpleAccount);
+        assertNotNull(node);

Review Comment:
   _Claude Code on behalf of gnodet_
   
   Correct — `new SObjectNode()` can never return null. Removed the pointless 
`assertNotNull(node)` and kept the meaningful assertions (`assertSame` for the 
object and `assertEquals` for the size).



##########
components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamEncodingTest.java:
##########
@@ -16,21 +16,28 @@
  */
 package org.apache.camel.component.stream;
 
+import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit6.CamelTestSupport;
 import org.junit.jupiter.api.Test;
 
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
 /**
  * Unit test for encoding option
  */
-public class StreamEncodingTest extends CamelTestSupport {
+class StreamEncodingTest extends CamelTestSupport {
 
     @Test
-    public void testStringContent() {
+    void testStringContent() {
         // include a UTF-8 char in the text \u0E08 is a Thai elephant
         String body = "Hello Thai Elephant \u0E08";
 
-        template.sendBody("direct:in", body);
+        Exchange result = template.send("direct:in", exchange -> 
exchange.getIn().setBody(body));
+        assertNotNull(result);
+        assertFalse(result.isFailed(), "Sending UTF-8 content should not cause 
an exchange failure");
+        assertNotNull(result.getIn().getBody(), "Exchange body should be 
preserved after sending");

Review Comment:
   _Claude Code on behalf of gnodet_
   
   Addressed — now uses `assertEquals(body, 
result.getIn().getBody(String.class))` to verify the body content is preserved 
after sending through the stream.



##########
components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamRouteBuilderTest.java:
##########
@@ -16,20 +16,30 @@
  */
 package org.apache.camel.component.stream;
 
+import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit6.CamelTestSupport;
 import org.junit.jupiter.api.Test;
 
-public class StreamRouteBuilderTest extends CamelTestSupport {
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+class StreamRouteBuilderTest extends CamelTestSupport {
 
     @Test
-    public void testStringContent() {
-        template.sendBody("direct:start", "this is text\n");
+    void testStringContent() {
+        Exchange result = template.send("direct:start", exchange -> 
exchange.getIn().setBody("this is text\n"));
+        assertNotNull(result);
+        assertFalse(result.isFailed(), "Sending string content should not 
cause an exchange failure");
+        assertNotNull(result.getIn().getBody(), "Exchange body should be 
preserved after sending");

Review Comment:
   _Claude Code on behalf of gnodet_
   
   Addressed — now uses `assertEquals(body, 
result.getIn().getBody(String.class))` to verify body content equality.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to