/** Test of blobExists method, of class FilesystemAsyncBlobStore. */
  public void testBlobExists() throws IOException {
    boolean result;
    String blobKey;

    // when location doesn't exists
    blobKey = TestUtils.createRandomBlobKey();
    try {
      blobStore.blobExists(CONTAINER_NAME, blobKey);
      fail();
    } catch (ContainerNotFoundException cnfe) {
      // expected
    }

    // when location exists
    blobStore.createContainerInLocation(null, CONTAINER_NAME);
    result = blobStore.blobExists(CONTAINER_NAME, blobKey);
    assertFalse(result, "Blob exists");

    // create blob
    TestUtils.createBlobAsFile(CONTAINER_NAME, blobKey, TestUtils.getImageForBlobPayload());
    result = blobStore.blobExists(CONTAINER_NAME, blobKey);
    assertTrue(result, "Blob doesn't exist");

    // complex path test
    blobKey = TestUtils.createRandomBlobKey("ss/asdas/", "");
    result = blobStore.blobExists(CONTAINER_NAME, blobKey);
    assertFalse(result, "Blob exists");
    TestUtils.createBlobAsFile(CONTAINER_NAME, blobKey, TestUtils.getImageForBlobPayload());
    result = blobStore.blobExists(CONTAINER_NAME, blobKey);
    assertTrue(result, "Blob doesn't exist");
  }