### Question:
GCPCredentialCopier { public void copyCredentials( FileSystem fs, Configuration conf, GCPCredentialPathProvider credentialPathProvider, DistributedFileSystemPathProvider dfsPathProvider) { try { Path source = credentialPathProvider.newPath(); Path destination = dfsPathProvider.newPath(conf); copyCredentialIntoHdfs(fs, source, destination); linkRelativePathInDistributedCache(conf, source, destination); } catch (IOException | URISyntaxException e) { throw new CircusTrainException(e); } }  void copyCredentials(
      FileSystem fs,
      Configuration conf,
      GCPCredentialPathProvider credentialPathProvider,
      DistributedFileSystemPathProvider dfsPathProvider);  }### Answer:
@Test public void copyCredentialsWithCredentialProviderSupplied() throws Exception { copier.copyCredentials(fileSystem, conf, credentialPathProvider, distributedFileSystemPathProvider); verify(fileSystem).copyFromLocalFile(credentialsFileRelativePath, dfsAbsolutePath); verify(fileSystem).deleteOnExit(dfsDirectory); assertNotNull(conf.get(DISTRIBUTED_CACHE_PROPERTY)); assertThat(conf.get(DISTRIBUTED_CACHE_PROPERTY), is(dfsAbsolutePath + SYMLINK_FLAG + credentialsFileRelativePath)); }
@Test(expected = CircusTrainException.class) public void copyCredentialsWhenFileDoesntExistThrowsException() throws Exception { doThrow(new IOException("File does not exist")) .when(fileSystem) .copyFromLocalFile(any(Path.class), any(Path.class)); copier.copyCredentials(fileSystem, conf, credentialPathProvider, distributedFileSystemPathProvider); }