public void testUpdate() throws Exception {
Post request1 = createFile("filestest.gpx");
request1.executeAsString();
String result1 = request1.getLocation();
int key = parseFileKey(result1);
HttpRequest request2 = updateFile(key, "filestest.bcr");
String result2 = request2.executeAsString();
assertEquals("file " + key + " updated", result2);
assertEquals(200, request2.getStatusCode());
assertTrue(request2.isSuccessful());
HttpRequest request3 = readFile(key);
String result3 = request3.executeAsString();
assertEquals(200, request3.getStatusCode());
assertTrue(request3.isSuccessful());
String expected3 = readFileToString("filestest.bcr");
assertEquals(expected3.length(), result3.length());
assertEquals(expected3, result3);
}