Github user GJL commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5232#discussion_r160216156
  
    --- Diff: 
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendStopTest.java
 ---
    @@ -98,24 +103,26 @@ public void testUnknownJobId() throws Exception {
                JobID jid = new JobID();
     
                String[] parameters = { jid.toString() };
    -           final ClusterClient clusterClient = createClusterClient(true);
    +           String expectedMessage = "Test exception";
    +           FlinkException testException = new 
FlinkException(expectedMessage);
    +           final ClusterClient<String> clusterClient = 
createClusterClient(testException);
                MockedCliFrontend testFrontend = new 
MockedCliFrontend(clusterClient);
     
                try {
                        testFrontend.stop(parameters);
                        fail("Should have failed.");
    -           } catch (IllegalArgumentException ignored) {
    -                   // expected
    +           } catch (FlinkException e) {
    +                   assertTrue(ExceptionUtils.findThrowableWithMessage(e, 
expectedMessage).isPresent());
                }
     
                Mockito.verify(clusterClient, times(1)).stop(any(JobID.class));
    --- End diff --
    
    I think I have written it on a previous PR: `verify` shouldn't be needed 
because you already assert if the exception was thrown.


---

Reply via email to