TaskExecutionProgressIndicator extends AbstractProgressIndicatorExBase { @Override public final void cancel() { super.cancel(); myBuildStopper.attemptToStopBuild(myTaskId, null); onCancel(); } TaskExecutionProgressIndicator(@NotNull ExternalSystemTaskId taskId, @NotNull BuildStopper buildStopper); @Override final void cancel();  }
@Test public void cancel() { MyTaskExecutionProgressIndicator indicator = new MyTaskExecutionProgressIndicator(myTaskId, myBuildStopper); indicator.cancel(); verify(myBuildStopper).attemptToStopBuild(myTaskId, null); assertTrue(indicator.onCancelInvoked); }