Introduction

This page shows how you can verify whether some container/blob is present at Microsoft Azure Blob Storage.

As in other RBV components the benefit is that verification client retries (verifies) as many times as needed in order to check that expected condition is or becomes true.

For this functionality you also need to import the dependency mentioned here.



Constructing the verification object


Create BlobStorageVerifications Instance
...
import com.axway.ats.rbv.azure.BlobStorageVerifications;
...

// verify blob
// the last argument is currently not implemented, so keep it false for now
BlobStorageVerifications blobStorateVerifications = new BlobStorageVerifications (CONNECTION_STRING, SAS_TOKEN, CONTAINER_NAME, BLOB_NAME, false);

// verify container
// Note the missing BLOB_NAME argument. This indicates that a container is about to be verified for something
BlobStorageVerifications blobStorateVerifications = new BlobStorageVerifications(CONNECTION_STRING, SAS_TOKEN, CONTAINER_NAME);

...


Add verification rules


Using the different check... methods you can add as many checks as you need.

Verification rules
// check the MD5 of the blob 
blobStorateVerifications.checkBlobMd5(md5);
// or if it must be different than some MD5 
blobStorateVerifications.checkBlobMd5Different(md5);

// check the size in bytes of the blob 
blobStorateVerifications.checkBlobModificationTime(modTime);
// alternative check
blobStorateVerifications.checkBlobModificationTimeDifferent(modTime);

// check the modification time in milliseconds since Epoch of the blob
blobStorateVerifications.checkBlobSize(size);
// alternative check
blobStorateVerifications.checkBlobSizeDifferent(size);


So far we have just specified what kind of object (file) we are interested in.

But the actual verification starts at the moment you call one of the verify... methods.



Verify that blob/container does not exist

Keep polling until verification that the searched blob/container is NOT present.

Fail if the searched blob/container is present for all polling attempts.

blobStorateVerifications.verifyBlobDoesNotExist();
blobStorateVerifications.verifyContainerDoesNotExist();



Verify that blob/container exists

Keep polling until verification that the searched blob/container IS present.

Fail if the searched blob/container is not presented for all polling attempts.

blobStorateVerifications.verifyBlobExist();
blobStorateVerifications.verifyContainerExists();



Verify that blob/container always exists

The next code will succeed if the searched blob/container is present for all polling attempts, otherwise it will fail.

blobStorateVerifications.verifyBlobAlwaysExist();
blobStorateVerifications.verifyContainerDoesNotExist();



Verify that blob/container never exists

The next code will succeed if the searched blob/container is NOT present for all polling attempts, otherwise it will fail.

blobStorateVerifications.verifyBlobNeverExist();
blobStorateVerifications.verifyContainerNeverExist();



Back to parent page

Go to Table of Contents