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

apupier 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 988325ef71a3 Fix assertions which are not complete
988325ef71a3 is described below

commit 988325ef71a3f65c83e8f12240921fc766239e74
Author: AurĂ©lien Pupier <[email protected]>
AuthorDate: Thu Jun 18 12:35:44 2026 +0200

    Fix assertions which are not complete
    
    see 
https://sonarcloud.io/project/issues?impactSeverities=BLOCKER&impactSoftwareQualities=MAINTAINABILITY&rules=java%3AS2970&issueStatuses=OPEN%2CCONFIRMED&id=apache_camel
    
    Signed-off-by: AurĂ©lien Pupier <[email protected]>
---
 .../org/apache/camel/component/milvus/it/MilvusComponentIT.java   | 6 +++---
 .../apache/camel/component/pinecone/it/PineconeComponentIT.java   | 8 ++++----
 .../org/apache/camel/diagram/DefaultRouteDiagramDumperTest.java   | 4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/components/camel-ai/camel-milvus/src/test/java/org/apache/camel/component/milvus/it/MilvusComponentIT.java
 
b/components/camel-ai/camel-milvus/src/test/java/org/apache/camel/component/milvus/it/MilvusComponentIT.java
index 191fa01e2be2..9213d899b16b 100644
--- 
a/components/camel-ai/camel-milvus/src/test/java/org/apache/camel/component/milvus/it/MilvusComponentIT.java
+++ 
b/components/camel-ai/camel-milvus/src/test/java/org/apache/camel/component/milvus/it/MilvusComponentIT.java
@@ -213,7 +213,7 @@ public class MilvusComponentIT extends MilvusTestSupport {
 
         assertThat(result).isNotNull();
         assertThat(result.getException()).isNull();
-        
assertThat(result.getMessage().getBody(SearchResponse.class).getRowRecords().size()
 == 2);
+        
assertThat(result.getMessage().getBody(SearchResponse.class).getRowRecords().get(0)).hasSize(2);
     }
 
     @Test
@@ -234,7 +234,7 @@ public class MilvusComponentIT extends MilvusTestSupport {
 
         assertThat(result).isNotNull();
         assertThat(result.getException()).isNull();
-        
assertThat(result.getMessage().getBody(QueryResults.class).getFieldsDataCount() 
== 2);
+        
assertThat(result.getMessage().getBody(QueryResults.class).getFieldsDataCount()).isEqualTo(2);
     }
 
     @Test
@@ -272,7 +272,7 @@ public class MilvusComponentIT extends MilvusTestSupport {
 
         assertThat(result).isNotNull();
         assertThat(result.getException()).isNull();
-        
assertThat(result.getMessage().getBody(SearchResponse.class).getRowRecords().size()
 == 0);
+        
assertThat(result.getMessage().getBody(SearchResponse.class).getRowRecords().get(0)).isEmpty();
     }
 
     // --- Helper-based tests (same operations via MilvusHelper beans) ---
diff --git 
a/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/it/PineconeComponentIT.java
 
b/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/it/PineconeComponentIT.java
index a33e83f607b5..5f8d59ff7b0e 100644
--- 
a/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/it/PineconeComponentIT.java
+++ 
b/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/it/PineconeComponentIT.java
@@ -108,7 +108,7 @@ public class PineconeComponentIT extends CamelTestSupport {
 
         assertThat(result).isNotNull();
         assertThat(result.getException()).isNull();
-        
assertThat(!result.getMessage().getBody(QueryResponseWithUnsignedIndices.class).getMatchesList().isEmpty());
+        
assertThat(result.getMessage().getBody(QueryResponseWithUnsignedIndices.class).getMatchesList()).isNotEmpty();
     }
 
     @Test
@@ -132,7 +132,7 @@ public class PineconeComponentIT extends CamelTestSupport {
 
         assertThat(result).isNotNull();
         assertThat(result.getException()).isNull();
-        
assertThat(!result.getMessage().getBody(QueryResponseWithUnsignedIndices.class).getMatchesList().isEmpty());
+        
assertThat(result.getMessage().getBody(QueryResponseWithUnsignedIndices.class).getMatchesList()).isNotEmpty();
     }
 
     @Test
@@ -148,7 +148,7 @@ public class PineconeComponentIT extends CamelTestSupport {
 
         assertThat(result).isNotNull();
         assertThat(result.getException()).isNull();
-        
assertThat(!result.getMessage().getBody(QueryResponseWithUnsignedIndices.class).getMatchesList().isEmpty());
+        
assertThat(result.getMessage().getBody(QueryResponseWithUnsignedIndices.class).getMatchesList()).isNotEmpty();
     }
 
     @Test
@@ -179,7 +179,7 @@ public class PineconeComponentIT extends CamelTestSupport {
 
         assertThat(result).isNotNull();
         assertThat(result.getException()).isNull();
-        
assertThat(result.getMessage().getBody(FetchResponse.class).getVectorsCount() 
!= 0);
+        
assertThat(result.getMessage().getBody(FetchResponse.class).getVectorsCount()).isNotZero();
     }
 
 }
diff --git 
a/components/camel-diagram/src/test/java/org/apache/camel/diagram/DefaultRouteDiagramDumperTest.java
 
b/components/camel-diagram/src/test/java/org/apache/camel/diagram/DefaultRouteDiagramDumperTest.java
index 6c76c95ae4be..8855c139680b 100644
--- 
a/components/camel-diagram/src/test/java/org/apache/camel/diagram/DefaultRouteDiagramDumperTest.java
+++ 
b/components/camel-diagram/src/test/java/org/apache/camel/diagram/DefaultRouteDiagramDumperTest.java
@@ -76,7 +76,7 @@ class DefaultRouteDiagramDumperTest extends CamelTestSupport {
         RouteDiagramDumper dumper = 
PluginHelper.getRouteDiagramDumper(context);
         dumper.dumpRoutesToFile("*", RouteDiagramDumper.Theme.DARK, f);
 
-        assertThat(f.exists());
+        assertThat(f).exists();
     }
 
     @Test
@@ -89,7 +89,7 @@ class DefaultRouteDiagramDumperTest extends CamelTestSupport {
         RouteDiagramDumper dumper = 
PluginHelper.getRouteDiagramDumper(context);
         dumper.dumpRoutesToFolder("*", RouteDiagramDumper.Theme.LIGHT, f);
 
-        assertThat(f.exists());
+        assertThat(f).exists();
         assertThat(f.list()).contains("myRoute.png", "otherRoute.png");
     }
 

Reply via email to