### Question:
DavHandler { public String retrieveTextFile(String url) throws IOException { GetMethod getMethod = new GetMethod(url); client.executeMethod(getMethod); downloadedFile = getMethod.getResponseBody(); getMethod.releaseConnection(); return new String(downloadedFile); } DavHandler(List<String> folderHierarchy); void saveLogs(String service, String evalId, List<String> logs); void saveText(String text, String url); void saveStream(InputStream stream, String url); void saveFiles(UrlParts urlParts, ToolResults urls); String getFolderHierarchyUrl(); String retrieveTextFile(String url); Set<String> getFileEndings();  }### Answer:
@Test public void testRetrieveTextFile() throws HttpException, IOException { DavHandler dav = new DavHandler(folders); InputStream stream = new ByteArrayInputStream("some text".getBytes()); PutMethod putMethod = new PutMethod( "http: putMethod.setRequestEntity(new InputStreamRequestEntity(stream)); HttpClient client = new HttpClient(); client.executeMethod(putMethod); stream.close(); putMethod.releaseConnection(); String retrieved = dav.retrieveTextFile("http: assertEquals("some text", retrieved); }