@@ -243,16 +243,15 @@ func (s *BlobRecordedTestsSuite) TestBlobStartCopyMetadata() {
243243 anotherBlobName := "copy" + blobName
244244 copyBlobClient := testcommon .GetBlockBlobClient (anotherBlobName , containerClient )
245245
246- var metadata = map [string ]string {"Bla" : "foo" }
247246 resp , err := copyBlobClient .StartCopyFromURL (context .Background (), bbClient .URL (), & blob.StartCopyFromURLOptions {
248- Metadata : metadata ,
247+ Metadata : testcommon . BasicMetadata ,
249248 })
250249 _require .Nil (err )
251250 waitForCopy (_require , copyBlobClient , resp )
252251
253252 resp2 , err := copyBlobClient .GetProperties (context .Background (), nil )
254253 _require .Nil (err )
255- _require .EqualValues (resp2 .Metadata , metadata )
254+ _require .EqualValues (resp2 .Metadata , testcommon . BasicMetadata )
256255}
257256
258257func (s * BlobRecordedTestsSuite ) TestBlobStartCopyMetadataNil () {
@@ -305,7 +304,7 @@ func (s *BlobRecordedTestsSuite) TestBlobStartCopyMetadataEmpty() {
305304 _ , err = copyBlobClient .Upload (context .Background (), streaming .NopCloser (bytes .NewReader ([]byte ("data" ))), nil )
306305 _require .Nil (err )
307306
308- metadata := make (map [string ]string )
307+ metadata := make (map [string ]* string )
309308 options := blob.StartCopyFromURLOptions {
310309 Metadata : metadata ,
311310 }
@@ -335,8 +334,8 @@ func (s *BlobRecordedTestsSuite) TestBlobStartCopyMetadataInvalidField() {
335334 anotherBlobName := "copy" + testcommon .GenerateBlobName (testName )
336335 copyBlobClient := testcommon .GetBlockBlobClient (anotherBlobName , containerClient )
337336
338- metadata := make (map [string ]string )
339- metadata ["I nvalid." ] = "foo"
337+ metadata := make (map [string ]* string )
338+ metadata ["I nvalid." ] = to . Ptr ( "foo" )
340339 options := blob.StartCopyFromURLOptions {
341340 Metadata : metadata ,
342341 }
@@ -924,8 +923,8 @@ func (s *BlobRecordedTestsSuite) TestBlobStartCopyDestIfMatchFalse() {
924923 },
925924 },
926925 }
927- metadata := make (map [string ]string )
928- metadata ["bla" ] = "bla"
926+ metadata := make (map [string ]* string )
927+ metadata ["bla" ] = to . Ptr ( "bla" )
929928 _ , err = destBlobClient .SetMetadata (context .Background (), metadata , nil )
930929 _require .Nil (err )
931930
@@ -1167,7 +1166,7 @@ func (s *BlobRecordedTestsSuite) TestBlobSnapshotMetadataInvalid() {
11671166 bbClient := testcommon .CreateNewBlockBlob (context .Background (), _require , blockBlobName , containerClient )
11681167
11691168 createBlobSnapshotOptions := blob.CreateSnapshotOptions {
1170- Metadata : map [string ]string {"Invalid Field!" : "value" },
1169+ Metadata : map [string ]* string {"Invalid Field!" : to . Ptr ( "value" ) },
11711170 }
11721171 _ , err = bbClient .CreateSnapshot (context .Background (), & createBlobSnapshotOptions )
11731172 _require .NotNil (err )
@@ -2729,7 +2728,7 @@ func (s *BlobRecordedTestsSuite) TestBlobSetMetadataNil() {
27292728 blockBlobName := testcommon .GenerateBlobName (testName )
27302729 bbClient := testcommon .CreateNewBlockBlob (context .Background (), _require , blockBlobName , containerClient )
27312730
2732- _ , err = bbClient .SetMetadata (context .Background (), map [string ]string {"not" : "nil" }, nil )
2731+ _ , err = bbClient .SetMetadata (context .Background (), map [string ]* string {"not" : to . Ptr ( "nil" ) }, nil )
27332732 _require .Nil (err )
27342733
27352734 _ , err = bbClient .SetMetadata (context .Background (), nil , nil )
@@ -2753,10 +2752,10 @@ func (s *BlobRecordedTestsSuite) TestBlobSetMetadataEmpty() {
27532752 blockBlobName := testcommon .GenerateBlobName (testName )
27542753 bbClient := testcommon .CreateNewBlockBlob (context .Background (), _require , blockBlobName , containerClient )
27552754
2756- _ , err = bbClient .SetMetadata (context .Background (), map [string ]string {"not" : "nil" }, nil )
2755+ _ , err = bbClient .SetMetadata (context .Background (), map [string ]* string {"not" : to . Ptr ( "nil" ) }, nil )
27572756 _require .Nil (err )
27582757
2759- _ , err = bbClient .SetMetadata (context .Background (), map [string ]string {}, nil )
2758+ _ , err = bbClient .SetMetadata (context .Background (), map [string ]* string {}, nil )
27602759 _require .Nil (err )
27612760
27622761 resp , err := bbClient .GetProperties (context .Background (), nil )
@@ -2777,7 +2776,7 @@ func (s *BlobRecordedTestsSuite) TestBlobSetMetadataInvalidField() {
27772776 blockBlobName := testcommon .GenerateBlobName (testName )
27782777 bbClient := testcommon .CreateNewBlockBlob (context .Background (), _require , blockBlobName , containerClient )
27792778
2780- _ , err = bbClient .SetMetadata (context .Background (), map [string ]string {"Invalid field!" : "value" }, nil )
2779+ _ , err = bbClient .SetMetadata (context .Background (), map [string ]* string {"Invalid field!" : to . Ptr ( "value" ) }, nil )
27812780 _require .NotNil (err )
27822781 _require .Contains (err .Error (), testcommon .InvalidHeaderErrorSubstring )
27832782 //_require.Equal(strings.Contains(err.Error(), testcommon.InvalidHeaderErrorSubstring), true)
0 commit comments