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 <jhq0812@gmail.com>
This commit is contained in:
Codegass 2022-09-03 02:40:25 -04:00 committed by GitHub
parent 1643bf3816
commit 0b2470286c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -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);