public void connectToRepository() throws KettleException {
    connectToRepository( currentRepository );
  }
@Test
  public void testConnectToRepository() throws Exception {
    when( pluginRegistry.loadClass( RepositoryPluginType.class, repositoryMeta.getId(), Repository.class ) )
      .thenReturn( repository );

    controller.setCurrentRepository( repositoryMeta );
    controller.connectToRepository();

    verify( repository ).init( repositoryMeta );
    verify( repository ).connect( null, null );
    verify( spoon, times( 1 ) ).clearRepositoryDirectory();
  }