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

smiklosovic pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/trunk by this push:
     new e4414cc268 Upgrade AssertJ to version 3.24.2
e4414cc268 is described below

commit e4414cc2686923ada325dfc85e1fcac641dad1ed
Author: Stefan Miklosovic <[email protected]>
AuthorDate: Thu Jul 27 13:30:31 2023 +0200

    Upgrade AssertJ to version 3.24.2
    
    patch by Shylaja Kokoori; reviewed by Stefan Miklosovic and Brandon 
Williams for CASSANDRA-17951
---
 .build/parent-pom-template.xml                                |  6 ++++--
 .../cassandra/distributed/test/SSTableIdGenerationTest.java   |  2 +-
 .../apache/cassandra/distributed/util/QueryResultUtil.java    | 11 ++++++-----
 test/unit/org/apache/cassandra/repair/RepairJobTest.java      |  2 +-
 4 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/.build/parent-pom-template.xml b/.build/parent-pom-template.xml
index 11073d5b18..b675cc153f 100644
--- a/.build/parent-pom-template.xml
+++ b/.build/parent-pom-template.xml
@@ -1047,17 +1047,19 @@
         <artifactId>j2objc-annotations</artifactId>
         <version>1.3</version>
       </dependency>
+      <!-- adding this dependency is necessary for assertj. When updating 
assertj, need to also update the version of
+           this that the new assertj's `assertj-parent-pom` depends on. -->
       <dependency>
         <groupId>org.junit</groupId>
         <artifactId>junit-bom</artifactId>
-        <version>5.6.0</version>
+        <version>5.9.1</version>
         <type>pom</type>
         <scope>test</scope>
       </dependency>
       <dependency>
         <groupId>org.assertj</groupId>
         <artifactId>assertj-core</artifactId>
-        <version>3.15.0</version>
+        <version>3.24.2</version>
         <scope>test</scope>
       </dependency>
       <dependency>
diff --git 
a/test/distributed/org/apache/cassandra/distributed/test/SSTableIdGenerationTest.java
 
b/test/distributed/org/apache/cassandra/distributed/test/SSTableIdGenerationTest.java
index db2244bc76..62f6139b34 100644
--- 
a/test/distributed/org/apache/cassandra/distributed/test/SSTableIdGenerationTest.java
+++ 
b/test/distributed/org/apache/cassandra/distributed/test/SSTableIdGenerationTest.java
@@ -532,6 +532,6 @@ public class SSTableIdGenerationTest extends TestBaseImpl
         SimpleQueryResult result = 
instance.executeInternalWithResult(format("SELECT * FROM %s.%s", ks, 
tableName));
         Object[][] rows = result.toObjectArrays();
         assertThat(rows).withFailMessage("Invalid results for %s.%s - should 
have %d rows but has %d: \n%s", ks, tableName, expectedNumber,
-                                         rows.length, 
result.toString()).hasSize(expectedNumber);
+                                         rows.length, 
result.toString()).hasNumberOfRows(expectedNumber);
     }
 }
diff --git 
a/test/distributed/org/apache/cassandra/distributed/util/QueryResultUtil.java 
b/test/distributed/org/apache/cassandra/distributed/util/QueryResultUtil.java
index 23d88e6ac5..6ac7c60fb0 100644
--- 
a/test/distributed/org/apache/cassandra/distributed/util/QueryResultUtil.java
+++ 
b/test/distributed/org/apache/cassandra/distributed/util/QueryResultUtil.java
@@ -29,6 +29,7 @@ import org.apache.cassandra.distributed.api.Row;
 import org.apache.cassandra.distributed.api.SimpleQueryResult;
 import org.apache.cassandra.tools.nodetool.formatter.TableBuilder;
 import org.assertj.core.api.Assertions;
+import org.assertj.core.data.Index;
 
 public class QueryResultUtil
 {
@@ -201,27 +202,27 @@ public class QueryResultUtil
         public SimpleQueryResultAssertHelper isEqualTo(Object... values)
         {
             Assertions.assertThat(qr.toObjectArrays())
-                      .hasSize(1)
-                      .contains(values);
+                      .hasNumberOfRows(1)
+                      .contains(values, Index.atIndex(0));
             return this;
         }
 
         public SimpleQueryResultAssertHelper hasSize(int size)
         {
-            Assertions.assertThat(qr.toObjectArrays()).hasSize(size);
+            Assertions.assertThat(qr.toObjectArrays()).hasNumberOfRows(size);
             return this;
         }
 
         public SimpleQueryResultAssertHelper hasSizeGreaterThan(int size)
         {
-            
Assertions.assertThat(qr.toObjectArrays()).hasSizeGreaterThan(size);
+            
Assertions.assertThat((qr.toObjectArrays()).length).isGreaterThan(size);
             return this;
         }
 
         public void isEmpty()
         {
             int size = Iterators.size(qr);
-            Assertions.assertThat(size).describedAs("QueryResult is not 
empty").isEqualTo(0);
+            Assertions.assertThat(size).describedAs("QueryResult is not 
empty").isZero();
         }
     }
 
diff --git a/test/unit/org/apache/cassandra/repair/RepairJobTest.java 
b/test/unit/org/apache/cassandra/repair/RepairJobTest.java
index 03ac2edc60..db7255f2f5 100644
--- a/test/unit/org/apache/cassandra/repair/RepairJobTest.java
+++ b/test/unit/org/apache/cassandra/repair/RepairJobTest.java
@@ -712,7 +712,7 @@ public class RepairJobTest
                                                                                
             false,
                                                                                
             PreviewKind.ALL));
 
-        
assertThat(tasks.values()).areAllInstanceOf(AsymmetricRemoteSyncTask.class);
+        
SyncTaskListAssert.assertThat(tasks.values()).areAllInstanceOf(AsymmetricRemoteSyncTask.class);
 
         // addr1 streams range1 from addr3:
         assertThat(tasks.get(pair(addr1, 
addr3)).rangesToSync).contains(RANGE_1);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to