public void testUploadFileToBlobCache() throws Exception {
String expected = "dummy content";
File tempFile = createTemporaryFile(expected);
ClusterSpec spec = getTestClusterSpec();
BlobCache cache = BlobCache.getInstance(ComputeCache.INSTANCE, spec);
try {
cache.putIfAbsent(tempFile);
HttpRequest req = cache.getSignedRequest(tempFile.getName());
assertThat(readContent(req), is(expected));
/* render download statement for visual test inspection */
LOG.info(cache.getAsSaveToStatement("/tmp",
tempFile.getName()).render(OsFamily.UNIX));
} finally {
BlobCache.dropAndCloseAll();
}