@Test(expected = ResourceNotFoundException.class)
public void testDeleteBucketDoesNotExist() {

    final String bucketId = "b1";
    when(metadataService.getBucketById(bucketId)).thenReturn(null);
    registryService.deleteBucket(bucketId);
}