Skip to content

Commit 8d49f75

Browse files
committed
[FLUSS-2091][common] Replaced Assertion Syntax for Exception-Handling Cases
[FLUSS-2091][common] Replaced Assertion Syntax for Exception-Handling Cases
1 parent 28cbf79 commit 8d49f75

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

fluss-common/src/test/java/org/apache/fluss/utils/ExceptionUtilsTest.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package org.apache.fluss.utils;
1919

20-
import org.junit.jupiter.api.Assertions;
2120
import org.junit.jupiter.api.Test;
2221

2322
import java.util.concurrent.CompletionException;
@@ -142,7 +141,13 @@ void testFirstOrSuppressedCyclePrevention() {
142141
assertThat(exceptionB.getSuppressed()).isEmpty();
143142

144143
// verify that processing suppressed exceptions no longer causes StackOverflowError
145-
Assertions.assertDoesNotThrow(() -> recursivelyProcessSuppressedExceptions(exceptionA));
144+
Throwable thrown = null;
145+
try {
146+
recursivelyProcessSuppressedExceptions(exceptionA);
147+
} catch (Throwable t) {
148+
thrown = t;
149+
}
150+
assertThat(thrown).isNull();
146151
}
147152

148153
@Test
@@ -165,7 +170,13 @@ void testFirstOrSuppressedCyclePreventionThroughCauseChain() {
165170
assertThat(exceptionA.getCause()).isEqualTo(exceptionB);
166171

167172
// verify that processing the cause chain no longer causes StackOverflowError
168-
Assertions.assertDoesNotThrow(() -> recursivelyProcessCauseChain(exceptionA));
173+
Throwable thrown = null;
174+
try {
175+
recursivelyProcessCauseChain(exceptionA);
176+
} catch (Throwable t) {
177+
thrown = t;
178+
}
179+
assertThat(thrown).isNull();
169180
}
170181

171182
@Test

0 commit comments

Comments
 (0)