You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ti...@apache.org on 2022/08/30 06:03:18 UTC

[curator] branch master updated: Introduce AssertJ for assertions

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

tison pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/curator.git


The following commit(s) were added to refs/heads/master by this push:
     new e70ef671 Introduce AssertJ for assertions
e70ef671 is described below

commit e70ef67105e41d589d5f855cf6d4013434122c34
Author: tison <wa...@gmail.com>
AuthorDate: Tue Aug 30 14:01:34 2022 +0800

    Introduce AssertJ for assertions
    
    AssertJ's assertions generate fruitful messages when there're failures.
    
    Signed-off-by: tison <wa...@gmail.com>
---
 curator-client/pom.xml                                             | 5 +++++
 curator-client/src/test/java/org/apache/curator/TestRetryLoop.java | 3 ++-
 pom.xml                                                            | 7 +++++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/curator-client/pom.xml b/curator-client/pom.xml
index 245c91eb..f0da5e98 100644
--- a/curator-client/pom.xml
+++ b/curator-client/pom.xml
@@ -87,6 +87,11 @@
             <artifactId>awaitility</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>
diff --git a/curator-client/src/test/java/org/apache/curator/TestRetryLoop.java b/curator-client/src/test/java/org/apache/curator/TestRetryLoop.java
index 0471a75f..abdc82e2 100644
--- a/curator-client/src/test/java/org/apache/curator/TestRetryLoop.java
+++ b/curator-client/src/test/java/org/apache/curator/TestRetryLoop.java
@@ -18,6 +18,7 @@
  */
 package org.apache.curator;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
@@ -108,7 +109,7 @@ public class TestRetryLoop extends BaseClassForTests
                 }
             }
 
-            assertTrue(loopCount >= 2);
+            assertThat(loopCount).isGreaterThanOrEqualTo(2);
         }
         finally
         {
diff --git a/pom.xml b/pom.xml
index 58fdc51c..5d176b7b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -82,6 +82,7 @@
         <commons-math-version>2.2</commons-math-version>
         <jackson-mapper-asl-version>1.9.13</jackson-mapper-asl-version>
         <jackson-version>2.10.0</jackson-version>
+        <assertj-version>3.23.1</assertj-version>
         <!-- Upgrading to Jersey 2.x is difficult and of unclear benefits, see
              https://stackoverflow.com/questions/17098341#22033825 -->
         <jersey-version>1.19.4</jersey-version>
@@ -382,6 +383,12 @@
                 <version>1.9.5</version>
             </dependency>
 
+            <dependency>
+                <groupId>org.assertj</groupId>
+                <artifactId>assertj-core</artifactId>
+                <version>${assertj-version}</version>
+            </dependency>
+
             <dependency>
                 <groupId>org.apache.curator</groupId>
                 <artifactId>curator-client</artifactId>