Skip to content

Commit

Permalink
Merge pull request #3 from gcheng/Jerusalem
Browse files Browse the repository at this point in the history
issure #77, let get blob properties throws an exception when the if
  • Loading branch information
Albert Cheng committed Jul 27, 2012
2 parents a1652c7 + 4ad59a4 commit 0040bcf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ public GetBlobPropertiesResult getBlobProperties(String container, String blob,
builder = addOptionalAccessContitionHeader(builder, options.getAccessCondition());

ClientResponse response = builder.method("HEAD", ClientResponse.class);
ThrowIfError(response);
ThrowIfNotSuccess(response);

return getBlobPropertiesResultFromResponse(response);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,24 @@ public void getBlobPropertiesWorks() throws Exception {
assertEquals(0, props.getSequenceNumber());
}

@Test(expected = ServiceException.class)
public void getBlobPropertiesIfNotModified() throws Exception {
// Arrange
Configuration config = createConfiguration();
BlobContract service = BlobService.create(config);
Date currentLastModifiedDate = new Date();

// Act
String container = TEST_CONTAINER_FOR_BLOBS;
String blob = "test";
service.createPageBlob(container, blob, 4096);
GetBlobPropertiesResult result = service.getBlobProperties(container, blob, new GetBlobPropertiesOptions()
.setAccessCondition(AccessCondition.ifModifiedSince(currentLastModifiedDate)));

// Assert
assertTrue(false);
}

@Test
public void getBlobMetadataWorks() throws Exception {
// Arrange
Expand Down

0 comments on commit 0040bcf

Please sign in to comment.