azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

Blob unit test failures in the dev-bookmark branch

Open jcookems opened this issue 14 years ago • 1 comments

In the dev-bookmark branch, the following unit tests fail:

  • com.microsoft.windowsazure.services.blob.BlobServiceIntegrationTest
    • getBlobwithIfNoneMatchETagAccessconditionWorks
    • getBlobWithIfModifiedSinceAccessconditionWorks

This issue was introduced with https://github.com/WindowsAzure/azure-sdk-for-java/commit/802e9b0f69ac0b7e35a0daf143dd2b934f0e4d34 , where PipelineHelpers.ThrowIfError changed what it considered to be an error from >=300 to >=400. This change is correct, but the getBlob code should consider >=300 as an error, because the server returns a 304 if it cannot give a match for the If-* headers.

A potential fix is to change the BlobRestProxy code to replace

    ThrowIfError(response);

with something like:

    // 304 is returned if the blob requested does not match the If-None-Match, etc. headers.
    if (response.getStatus() >= 300) {
        throw new UniformInterfaceException(response);
    }

jcookems avatar Apr 05 '12 01:04 jcookems

Since this is a regression from already released code, we need to fix this. Al can you do an investigation/fix it if its easy.

joostdenijs avatar Apr 05 '12 20:04 joostdenijs