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

albumenj pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.1 by this push:
     new 0b2470286c Refactoring app response test with JUnit Assume (#10537)
0b2470286c is described below

commit 0b2470286c842c08062d2cbc5d8c22ee448a1da2
Author: Codegass <[email protected]>
AuthorDate: Sat Sep 3 02:40:25 2022 -0400

    Refactoring app response test with JUnit Assume (#10537)
    
    * Remove unused import
    
    * Introduce Junit5 Assume functions to replace the if-return precondition 
check, FIX #10487
    
    Co-authored-by: Albumen Kevin <[email protected]>
---
 .../src/test/java/org/apache/dubbo/rpc/AppResponseTest.java      | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git 
a/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/AppResponseTest.java
 
b/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/AppResponseTest.java
index 7549692097..aee142ac2e 100644
--- 
a/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/AppResponseTest.java
+++ 
b/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/AppResponseTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.dubbo.rpc;
 
+import static org.junit.jupiter.api.Assumptions.assumeFalse;
 
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
@@ -39,9 +40,7 @@ public class AppResponseTest {
     @Test
     public void testAppResponseWithEmptyStackTraceException() {
         Throwable throwable = buildEmptyStackTraceException();
-        if (throwable == null) {
-            return;
-        }
+        assumeFalse(throwable == null);
         AppResponse appResponse = new AppResponse(throwable);
 
         StackTraceElement[] stackTrace = 
appResponse.getException().getStackTrace();
@@ -66,9 +65,7 @@ public class AppResponseTest {
     @Test
     public void testSetExceptionWithEmptyStackTraceException() {
         Throwable throwable = buildEmptyStackTraceException();
-        if (throwable == null) {
-            return;
-        }
+        assumeFalse(throwable == null);
         AppResponse appResponse = new AppResponse();
         appResponse.setException(throwable);
 

Reply via email to