public void edit( RunConfiguration runConfiguration ) {
    final String key = runConfiguration.getName();
    RunConfigurationDialog dialog =
      new RunConfigurationDialog( spoonSupplier.get().getShell(), configurationManager,
        runConfiguration );
    RunConfiguration savedRunConfiguration = dialog.open();

    if ( savedRunConfiguration != null ) {
      configurationManager.delete( key );
      configurationManager.save( savedRunConfiguration );
      refreshTree();

      updateLoadedJobs( key, savedRunConfiguration );
    }
  }
@Test
  public void testEdit() throws Exception {
    DefaultRunConfiguration config = new DefaultRunConfiguration();
    config.setName( "Test" );
    config.setServer( "localhost" );

    doNothing().when( delegate ).updateLoadedJobs( "Test", config );

    try ( MockedConstruction<RunConfigurationDialog> mockedConfDialog = mockConstruction( RunConfigurationDialog.class,
      (mock, context) -> when( mock.open() ).thenReturn( config ) ) ) {
      delegate.edit( config );

      verify( delegate, times( 1 ) ).updateLoadedJobs( "Test", config );
      verify( service, times( 1 ) ).delete( "Test" );
      verify( service, times( 1 ) ).save( config );
      verify( spoon, times( 1 ) ).refreshTree( RunConfigurationFolderProvider.STRING_RUN_CONFIGURATIONS );
    }
  }