### Question:
HdfsDeployer { public void undeploy() throws Exception { Path dst = getDestinationHdfsPath(); if (context.getFileSystem().exists(dst)) { context.getFileSystem().delete(dst, true); } } HdfsDeployer(CelosCiContext context); void undeploy(); void deploy();  }### Answer:
@Test public void testUndeploy() throws Exception { CelosCiContext context = mock(CelosCiContext.class); File remoteHdfsFolder = tempDir.newFolder(); doReturn(LocalFileSystem.get(new Configuration())).when(context).getFileSystem(); doReturn(remoteHdfsFolder.getAbsolutePath()).when(context).getHdfsPrefix(); doReturn("workflow").when(context).getWorkflowName(); doReturn("/some/hdfs/root").when(context).getHdfsRoot(); File remoteDir = new File(remoteHdfsFolder, "some/hdfs/root/workflow"); remoteDir.mkdirs(); new File(remoteDir, "file").createNewFile(); HdfsDeployer deployer = new HdfsDeployer(context); deployer.undeploy(); Assert.assertFalse(remoteDir.exists()); }