public <T extends VFSConnectionDetails> boolean test( @NonNull ConnectionManager manager,
                                                        @NonNull T details,
                                                        @Nullable VFSConnectionTestOptions options )
    throws KettleException {

    if ( options == null ) {
      options = new VFSConnectionTestOptions();
    }

    // The specified connection details may not exist saved in the meta-store,
    // but still needs to have a non-empty name in it, to be able to form a temporary PVFS URI.
    if ( StringUtils.isEmpty( details.getName() ) ) {
      return false;
    }

    VFSConnectionProvider<T> provider = getExistingProvider( manager, details );
    if ( !provider.test( details ) ) {
      return false;
    }

    if ( !details.isRootPathSupported() || options.isRootPathIgnored() ) {
      return true;
    }

    String resolvedRootPath;
    try {
      resolvedRootPath = getResolvedRootPath( details );
    } catch ( KettleException e ) {
      // Invalid root path.
      return false;
    }

    if ( resolvedRootPath == null ) {
      return !details.isRootPathRequired();
    }

    // Ensure that root path exists and is a folder.
    return isFolder( getConnectionRootProviderFileObject( manager, provider, details ) );
  }
@Test
  public void testTestReturnsTrueWithValidButNotNormalizedRootPath() throws KettleException {

    when( vfsConnectionDetails.getRootPath() ).thenReturn( "./sub-folder/\\../other-sub-folder//" );

    assertTrue( vfsConnectionManagerHelper.test( connectionManager, vfsConnectionDetails, getTestOptionsCheckRootPath() ) );
  }