@NonNull
  public <T extends VFSConnectionDetails> VFSConnectionProvider<T> getExistingProvider(
    @NonNull ConnectionManager manager,
    @Nullable String key )
    throws KettleException {

    VFSConnectionProvider<T> provider = getProvider( manager, key );
    if ( provider == null ) {
      throw new KettleException( String.format( "Undefined connection provider for key '%s'.", key ) );
    }

    return provider;
  }
@Test( expected = KettleException.class )
  public void testGetExistingProviderOfDetailsReturnsNullForNonExistingProviderInManager() throws KettleException {
    String provider1Key = "missingProvider1";

    VFSConnectionDetails details1 = mock( VFSConnectionDetails.class );
    doReturn( provider1Key ).when( details1 ).getType();

    vfsConnectionManagerHelper.getExistingProvider( connectionManager, details1 );
  }