reswqa commented on code in PR #20153:
URL: https://github.com/apache/flink/pull/20153#discussion_r917229294


##########
flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTest.java:
##########
@@ -1384,8 +1374,9 @@ public void testRequestPartitionState() throws Exception {
                 fail("Expected failure.");
             } catch (ExecutionException e) {
                 assertThat(
-                        ExceptionUtils.findThrowable(e, 
IllegalArgumentException.class).isPresent(),
-                        is(true));
+                                ExceptionUtils.findThrowable(e, 
IllegalArgumentException.class)

Review Comment:
   I think this code block can replaced by 
   ```
   Assertions.assertThatThrownBy(() -> unknownPartitionStateFuture.get())
                       .isInstanceOf(ExecutionException.class)
                       
.satisfies(FlinkAssertions.anyCauseMatches(IllegalArgumentException.class));
   ```
   `unknownPartitionStateFuture` is a new local variable as follow:
   ```
   CompletableFuture<ExecutionState> unknownPartitionStateFuture =
                       jobMasterGateway.requestPartitionState(
                               partition.getResultId(), new 
ResultPartitionID());
   ```
   Because lambda expressions require final variables



-- 
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]

Reply via email to