@@ -589,6 +589,9 @@ func TestIntegration_BucketUpdate(t *testing.T) {
589
589
if ! testutil .Equal (attrs .Labels , wantLabels ) {
590
590
t .Fatalf ("add labels: got %v, want %v" , attrs .Labels , wantLabels )
591
591
}
592
+ if ! attrs .Created .Before (attrs .Updated ) {
593
+ t .Errorf ("got attrs.Updated %v before attrs.Created %v, want Attrs.Updated to be after" , attrs .Updated , attrs .Created )
594
+ }
592
595
593
596
// Turn off versioning again; add and remove some more labels.
594
597
ua = BucketAttrsToUpdate {VersioningEnabled : false }
@@ -607,6 +610,9 @@ func TestIntegration_BucketUpdate(t *testing.T) {
607
610
if ! testutil .Equal (attrs .Labels , wantLabels ) {
608
611
t .Fatalf ("got %v, want %v" , attrs .Labels , wantLabels )
609
612
}
613
+ if ! attrs .Created .Before (attrs .Updated ) {
614
+ t .Errorf ("got attrs.Updated %v before attrs.Created %v, want Attrs.Updated to be after" , attrs .Updated , attrs .Created )
615
+ }
610
616
611
617
// Configure a lifecycle
612
618
wantLifecycle := Lifecycle {
@@ -626,6 +632,9 @@ func TestIntegration_BucketUpdate(t *testing.T) {
626
632
if ! testutil .Equal (attrs .Lifecycle , wantLifecycle ) {
627
633
t .Fatalf ("got %v, want %v" , attrs .Lifecycle , wantLifecycle )
628
634
}
635
+ if ! attrs .Created .Before (attrs .Updated ) {
636
+ t .Errorf ("got attrs.Updated %v before attrs.Created %v, want Attrs.Updated to be after" , attrs .Updated , attrs .Created )
637
+ }
629
638
// Check that StorageClass has "STANDARD" value for unset field by default
630
639
// before passing new value.
631
640
wantStorageClass := "STANDARD"
@@ -638,6 +647,9 @@ func TestIntegration_BucketUpdate(t *testing.T) {
638
647
if ! testutil .Equal (attrs .StorageClass , wantStorageClass ) {
639
648
t .Fatalf ("got %v, want %v" , attrs .StorageClass , wantStorageClass )
640
649
}
650
+ if ! attrs .Created .Before (attrs .Updated ) {
651
+ t .Errorf ("got attrs.Updated %v before attrs.Created %v, want Attrs.Updated to be after" , attrs .Updated , attrs .Created )
652
+ }
641
653
642
654
// Empty update should succeed without changing the bucket.
643
655
gotAttrs , err := b .Update (ctx , BucketAttrsToUpdate {})
@@ -647,6 +659,9 @@ func TestIntegration_BucketUpdate(t *testing.T) {
647
659
if ! testutil .Equal (attrs , gotAttrs ) {
648
660
t .Fatalf ("empty update: got %v, want %v" , gotAttrs , attrs )
649
661
}
662
+ if ! attrs .Created .Before (attrs .Updated ) {
663
+ t .Errorf ("got attrs.Updated %v before attrs.Created %v, want Attrs.Updated to be after" , attrs .Updated , attrs .Created )
664
+ }
650
665
})
651
666
}
652
667
0 commit comments