### Question:
PDIImportUtil { public static Repository connectToRepository( String repositoryName ) throws KettleException { return repositoryFactory.connect( repositoryName ); }  static Repository connectToRepository( String repositoryName ); static void setRepositoryFactory( IRepositoryFactory factory ); static Document loadXMLFrom( String xml ); static Document loadXMLFrom( InputStream is ); static String asXml( Document document );  }### Answer:
@Test public void testConnectToRepository() throws Exception { IRepositoryFactory mock = mock( IRepositoryFactory.class ); PDIImportUtil.setRepositoryFactory( mock ); PDIImportUtil.connectToRepository( "foo" ); verify( mock, times( 1 ) ).connect( "foo" ); }