  @Test
  @DisplayName("Show blocking dialog and close by clicking on one of the dialog buttons")
  void showDialogBlockingCloseButton() {

    robot.interact(() -> {
      when(mockDialog.isBlocking()).thenReturn(true);

      assertDialogNotShown();

      WorkbenchDialog result = workbench.showDialog(mockDialog);

      assertDialogShown(result, true);
      verify(mockDialog, atLeastOnce()).isBlocking(); // call showOverlay(...) inside showDialog()
      verify(mockDialog, atLeastOnce()).getButtonTypes();
      verify(mockDialog, atLeastOnce()).getDialogControl();
      verify(mockDialog, never()).getOnResult();
      verify(mockOnResult, never()).accept(any());
      ObservableList<Button> buttons = dialogControl.getButtons();
      assertSame(buttonTypes.size(), buttons.size());

      // hiding by button press
      ButtonType toPress = buttonTypes.get(0);
      simulateDialogButtonClick(dialogControl, toPress);

      verify(mockDialog, atLeast(0)).blockingProperty(); // ignore calls
      verify(mockDialog).getOnResult();
      verify(mockDialog, atLeastOnce()).getDialogControl();
      verify(mockOnResult).accept(toPress);
      verifyNoMoreInteractions(mockDialog);
      verifyNoMoreInteractions(mockOnResult);
      assertDialogNotShown();
    });
  }