reswqa commented on code in PR #21999:
URL: https://github.com/apache/flink/pull/21999#discussion_r1116563643
##########
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/StreamTaskTest.java:
##########
@@ -368,17 +368,19 @@ void testCleanUpExceptionSuppressing() throws Exception {
.setupOutputForSingletonOperatorChain(new
FailingTwiceOperator())
.build()) {
- assertThatThrownBy(
- () -> {
- testHarness.processElement(new
StreamRecord<>("Doesn't matter", 0));
- throw new RuntimeException(
- "Expected an exception but ran
successfully");
- })
- .isInstanceOf(ExpectedTestException.class);
+ try {
+ testHarness.processElement(new StreamRecord<>("Doesn't
matter", 0));
+ throw new RuntimeException("Expected an exception but ran
successfully");
+ } catch (Exception ex) {
+ ExceptionUtils.assertThrowable(ex,
ExpectedTestException.class);
+ }
Review Comment:
```suggestion
Assertions.assertThatThrownBy(
() ->
testHarness.processElement(
new StreamRecord<>("Doesn't
matter", 0)))
.satisfies(
throwable ->
ExceptionUtils.assertThrowable(
throwable,
ExpectedTestException.class));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]