@Test
public void testLocalizeNonHdfsRemoteUri() throws IOException {

  when(remoteDirectoryManager.isRemote(anyString())).thenReturn(true);
  when(remoteDirectoryManager.existsRemoteFile(anyString()))
      .thenReturn(true);
  String remoteUri = "remote://remotedir1/remotedir2";
  when(fsOperations.uploadToRemoteFile(any(Path.class), anyString()))
      .thenReturn(new Path(remoteUri));
  String downloadedFileName = "remotedir2_221424";
  when(fsOperations.download(anyString(), anyString()))
      .thenReturn(downloadedFileName);
  Localization localization = new Localization();
  localization.setLocalPath("/remotedir2");
  localization.setRemoteUri(remoteUri);
  Localizer localizer = createLocalizerWithLocalizations(localization);
  localizer.handleLocalizations(service);
  verify(fsOperations).validFileSize(anyString());
  verify(fsOperations).deleteFiles(eq(downloadedFileName));
  verify(fsOperations).uploadToRemoteFile(any(Path.class),
      eq(downloadedFileName));
  List<ConfigFile> files = service.getConfiguration().getFiles();
  assertEquals(1, files.size());
  ConfigFile configFile = files.get(0);
  assertEquals(TypeEnum.STATIC, configFile.getType());
  assertEquals(remoteUri, configFile.getSrcFile());
  assertEquals("remotedir2", configFile.getDestFile());
  assertEquals(1, service.getConfiguration().getEnv().size());
  String dockerMounts = service.getConfiguration().getEnv()
      .get(EnvironmentUtilities.ENV_DOCKER_MOUNTS_FOR_CONTAINER_RUNTIME);
  assertEquals("remotedir2:/remotedir2:rw", dockerMounts);
}