You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by sh...@apache.org on 2022/05/12 07:00:07 UTC

[servicecomb-java-chassis] branch master updated: [SCB-2498] bump assertj-core from 3.11.1 to 3.22.0 (#2866)

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

shoothzj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git


The following commit(s) were added to refs/heads/master by this push:
     new d6c37ddee [SCB-2498] bump assertj-core from 3.11.1 to 3.22.0 (#2866)
d6c37ddee is described below

commit d6c37ddeedff2772213e046e8f12bdeac25a341a
Author: Lico-Tom <95...@users.noreply.github.com>
AuthorDate: Thu May 12 15:00:00 2022 +0800

    [SCB-2498] bump assertj-core from 3.11.1 to 3.22.0 (#2866)
---
 .../servicecomb/core/filter/FilterChainTest.java   | 10 ++++----
 .../filter/impl/ProducerOperationFilterTest.java   | 30 ++++++++++++++--------
 dependencies/default/pom.xml                       |  2 +-
 3 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/core/src/test/java/org/apache/servicecomb/core/filter/FilterChainTest.java b/core/src/test/java/org/apache/servicecomb/core/filter/FilterChainTest.java
index 85b805c0b..aa78b07a5 100644
--- a/core/src/test/java/org/apache/servicecomb/core/filter/FilterChainTest.java
+++ b/core/src/test/java/org/apache/servicecomb/core/filter/FilterChainTest.java
@@ -24,6 +24,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.catchThrowable;
 
 import java.io.IOException;
+import java.time.Duration;
 import java.util.List;
 import java.util.Vector;
 import java.util.concurrent.CompletableFuture;
@@ -146,12 +147,11 @@ public class FilterChainTest {
 
     CompletableFuture<Response> future = buildChain(retryFilter, recordThreadFilter, exceptionFilter)
         .onFilter(invocation);
-
-    assertThat(msg).containsExactly("main", "main", "main");
     assertThat(future)
-        .hasFailedWithThrowableThat()
-        .isExactlyInstanceOf(IOException.class)
-        .hasMessage("net error");
+            .failsWithin(Duration.ofSeconds(1))
+            .withThrowableOfType(ExecutionException.class)
+            .withCauseExactlyInstanceOf(IOException.class)
+            .withMessage("java.io.IOException: net error");
   }
 
   @Test
diff --git a/core/src/test/java/org/apache/servicecomb/core/filter/impl/ProducerOperationFilterTest.java b/core/src/test/java/org/apache/servicecomb/core/filter/impl/ProducerOperationFilterTest.java
index fd932f1b9..b7403e987 100644
--- a/core/src/test/java/org/apache/servicecomb/core/filter/impl/ProducerOperationFilterTest.java
+++ b/core/src/test/java/org/apache/servicecomb/core/filter/impl/ProducerOperationFilterTest.java
@@ -22,7 +22,9 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.catchThrowable;
 
 import java.lang.reflect.Method;
+import java.time.Duration;
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
 
 import org.apache.servicecomb.core.Invocation;
 import org.apache.servicecomb.core.exception.Exceptions;
@@ -136,9 +138,12 @@ public class ProducerOperationFilterTest {
 
     CompletableFuture<Response> future = filter.onFilter(invocation, FilterNode.EMPTY);
 
-    assertThat(future).hasFailedWithThrowableThat()
-        .isInstanceOf(RuntimeExceptionWithoutStackTrace.class)
-        .hasMessage("syncException");
+    assertThat(future)
+            .failsWithin(Duration.ofSeconds(1))
+            .withThrowableOfType(ExecutionException.class)
+            .withCauseExactlyInstanceOf(RuntimeExceptionWithoutStackTrace.class)
+            .withMessage("org.apache.servicecomb.foundation.test.scaffolding.exception" +
+                    ".RuntimeExceptionWithoutStackTrace: syncException");
   }
 
   @Test
@@ -165,9 +170,12 @@ public class ProducerOperationFilterTest {
 
     CompletableFuture<Response> future = filter.onFilter(invocation, FilterNode.EMPTY);
 
-    assertThat(future).hasFailedWithThrowableThat()
-        .isInstanceOf(RuntimeExceptionWithoutStackTrace.class)
-        .hasMessage("asyncException");
+    assertThat(future)
+            .failsWithin(Duration.ofSeconds(1))
+            .withThrowableOfType(ExecutionException.class)
+            .withCauseExactlyInstanceOf(RuntimeExceptionWithoutStackTrace.class)
+            .withMessage("org.apache.servicecomb.foundation.test.scaffolding" +
+                    ".exception.RuntimeExceptionWithoutStackTrace: asyncException");
   }
 
   @Test
@@ -179,11 +187,13 @@ public class ProducerOperationFilterTest {
         result = new Object[] {1};
       }
     };
-
     CompletableFuture<Response> future = filter.onFilter(invocation, FilterNode.EMPTY);
-    assertThat(future).hasFailedWithThrowableThat()
-        .isInstanceOf(IllegalArgumentException.class)
-        .hasMessage("wrong number of arguments");
+
+    assertThat(future)
+            .failsWithin(Duration.ofSeconds(1))
+            .withThrowableOfType(ExecutionException.class)
+            .withCauseExactlyInstanceOf(IllegalArgumentException.class)
+            .withMessage("java.lang.IllegalArgumentException: wrong number of arguments");
 
     InvocationException throwable = Exceptions
         .convert(invocation, catchThrowable(() -> future.get()), INTERNAL_SERVER_ERROR);
diff --git a/dependencies/default/pom.xml b/dependencies/default/pom.xml
index 68d47465e..9d0e292d8 100644
--- a/dependencies/default/pom.xml
+++ b/dependencies/default/pom.xml
@@ -36,7 +36,7 @@
     <asciidoctorj.version>1.6.2</asciidoctorj.version>
     <aspectj.version>1.9.3</aspectj.version>
     <awaitility.version>3.0.0</awaitility.version>
-    <assertj.version>3.11.1</assertj.version>
+    <assertj.version>3.22.0</assertj.version>
     <brave.version>5.6.0</brave.version>
     <classmate.version>1.5.1</classmate.version>
     <commons-beanutils.version>1.9.4</commons-beanutils.version>