@@ -58,10 +58,6 @@ func TestCreateScratchBucketNoSourceFileDefaultBucketCreatedBasedOnDefaultRegion
5858 SoftDeletePolicy : & storage.SoftDeletePolicy {RetentionDuration : 0 },
5959 }).Return (nil )
6060
61- mockStorageClient .EXPECT ().UpdateBucket (expectedBucket , storage.BucketAttrsToUpdate {
62- SoftDeletePolicy : & storage.SoftDeletePolicy {RetentionDuration : 0 },
63- }).Return (nil )
64-
6561 c := ScratchBucketCreator {mockStorageClient , ctx , createMockBucketIteratorWithRandomBuckets (mockCtrl , & ctx , mockStorageClient , project )}
6662 bucket , region , err := c .CreateScratchBucket ("" , project , "" , true )
6763 assert .Equal (t , expectedBucket , bucket )
@@ -87,10 +83,6 @@ func TestCreateScratchBucketNoSourceFileTranslateGoogleDomainDefaultBucketCreate
8783 SoftDeletePolicy : & storage.SoftDeletePolicy {RetentionDuration : 0 },
8884 }).Return (nil )
8985
90- mockStorageClient .EXPECT ().UpdateBucket (expectedBucket , storage.BucketAttrsToUpdate {
91- SoftDeletePolicy : & storage.SoftDeletePolicy {RetentionDuration : 0 },
92- }).Return (nil )
93-
9486 c := ScratchBucketCreator {mockStorageClient , ctx , createMockBucketIteratorWithRandomBuckets (mockCtrl , & ctx , mockStorageClient , project )}
9587 bucket , region , err := c .CreateScratchBucket ("" , project , "" , true )
9688 assert .Equal (t , expectedBucket , bucket )
@@ -116,10 +108,6 @@ func TestCreateScratchBucketNoSourceFileBucketCreatedBasedOnInputZone(t *testing
116108 SoftDeletePolicy : & storage.SoftDeletePolicy {RetentionDuration : 0 },
117109 }).Return (nil )
118110
119- mockStorageClient .EXPECT ().UpdateBucket (expectedBucket , storage.BucketAttrsToUpdate {
120- SoftDeletePolicy : & storage.SoftDeletePolicy {RetentionDuration : 0 },
121- }).Return (nil )
122-
123111 c := ScratchBucketCreator {mockStorageClient , ctx , createMockBucketIteratorWithRandomBuckets (mockCtrl , & ctx , mockStorageClient , project )}
124112 bucket , region , err := c .CreateScratchBucket ("" , project , "asia-east1-b" , true )
125113 assert .Equal (t , expectedBucket , bucket )
@@ -185,9 +173,7 @@ func TestCreateScratchBucketNewBucketCreatedProject(t *testing.T) {
185173 mockStorageClient := mocks .NewMockStorageClientInterface (mockCtrl )
186174 mockStorageClient .EXPECT ().GetBucketAttrs (sourceBucketAttrs .Name ).Return (sourceBucketAttrs , nil ).Times (1 )
187175 mockStorageClient .EXPECT ().CreateBucket ("project1-daisy-bkt-us-west2" , project , scratchBucketAttrs ).Return (nil ).Times (1 )
188- mockStorageClient .EXPECT ().UpdateBucket ("project1-daisy-bkt-us-west2" , storage.BucketAttrsToUpdate {
189- SoftDeletePolicy : & storage.SoftDeletePolicy {RetentionDuration : 0 },
190- }).Return (nil ).Times (1 )
176+
191177 mockBucketIterator := mocks .NewMockBucketIteratorInterface (mockCtrl )
192178 first := mockBucketIterator .EXPECT ().Next ().Return (anotherBucketAttrs , nil )
193179 second := mockBucketIterator .EXPECT ().Next ().Return (sourceBucketAttrs , nil )
@@ -244,9 +230,6 @@ func TestCreateScratchBucketErrorRetrievingSourceFileBucketMetadataDefaultBucket
244230 SoftDeletePolicy : & storage.SoftDeletePolicy {RetentionDuration : 0 },
245231 }).Return (nil )
246232
247- mockStorageClient .EXPECT ().UpdateBucket (expectedBucket , storage.BucketAttrsToUpdate {
248- SoftDeletePolicy : & storage.SoftDeletePolicy {RetentionDuration : 0 },
249- }).Return (nil ).Times (1 )
250233 c := ScratchBucketCreator {mockStorageClient , ctx , createMockBucketIteratorWithRandomBuckets (mockCtrl , & ctx , mockStorageClient , project )}
251234 bucket , region , err := c .CreateScratchBucket ("gs://sourcebucket/sourcefile" , project , "" , true )
252235 assert .Equal (t , expectedBucket , bucket )
@@ -273,10 +256,6 @@ func TestCreateScratchBucketErrorRetrievingSourceFileBucketMetadataBucketCreated
273256 SoftDeletePolicy : & storage.SoftDeletePolicy {RetentionDuration : 0 },
274257 }).Return (nil )
275258
276- mockStorageClient .EXPECT ().UpdateBucket (expectedBucket , storage.BucketAttrsToUpdate {
277- SoftDeletePolicy : & storage.SoftDeletePolicy {RetentionDuration : 0 },
278- }).Return (nil )
279-
280259 c := ScratchBucketCreator {mockStorageClient , ctx , createMockBucketIteratorWithRandomBuckets (mockCtrl , & ctx , mockStorageClient , project )}
281260 bucket , region , err := c .CreateScratchBucket ("gs://sourcebucket/sourcefile" , project , "asia-east1-b" , true )
282261 assert .Equal (t , expectedBucket , bucket )
@@ -303,10 +282,6 @@ func TestCreateScratchBucketNilSourceFileBucketMetadataDefaultBucketCreated(t *t
303282 SoftDeletePolicy : & storage.SoftDeletePolicy {RetentionDuration : 0 },
304283 }).Return (nil )
305284
306- mockStorageClient .EXPECT ().UpdateBucket (expectedBucket , storage.BucketAttrsToUpdate {
307- SoftDeletePolicy : & storage.SoftDeletePolicy {RetentionDuration : 0 },
308- }).Return (nil )
309-
310285 c := ScratchBucketCreator {mockStorageClient , ctx , createMockBucketIteratorWithRandomBuckets (mockCtrl , & ctx , mockStorageClient , project )}
311286 bucket , region , err := c .CreateScratchBucket ("gs://sourcebucket/sourcefile" , project , "" , true )
312287 assert .Equal (t , expectedBucket , bucket )
@@ -381,9 +356,6 @@ func TestCreateScratchBucketReturnsExistingScratchBucketNoCreate(t *testing.T) {
381356 Return (mockBucketIterator ).
382357 Times (1 )
383358
384- mockStorageClient .EXPECT ().UpdateBucket ("project1-daisy-bkt-us-west2" , storage.BucketAttrsToUpdate {
385- SoftDeletePolicy : & storage.SoftDeletePolicy {RetentionDuration : 0 },
386- }).Return (nil ).Times (1 )
387359 c := ScratchBucketCreator {mockStorageClient , ctx , mockBucketIteratorCreator }
388360 bucket , region , err := c .CreateScratchBucket ("gs://sourcebucket/sourcefile" , projectID , "" , true )
389361 assert .Equal (t , "project1-daisy-bkt-us-west2" , bucket )
0 commit comments