|
|
|
@ -500,6 +500,7 @@ func TestValidateObjectLockConfiguration(t *testing.T) { |
|
|
|
DefaultRetention: &DefaultRetention{ |
|
|
|
Mode: "GOVERNANCE", |
|
|
|
Days: 30, |
|
|
|
DaysSet: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -513,6 +514,7 @@ func TestValidateObjectLockConfiguration(t *testing.T) { |
|
|
|
DefaultRetention: &DefaultRetention{ |
|
|
|
Mode: "COMPLIANCE", |
|
|
|
Years: 1, |
|
|
|
YearsSet: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -548,6 +550,8 @@ func TestValidateObjectLockConfiguration(t *testing.T) { |
|
|
|
Mode: "GOVERNANCE", |
|
|
|
Days: 30, |
|
|
|
Years: 1, |
|
|
|
DaysSet: true, |
|
|
|
YearsSet: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -575,6 +579,7 @@ func TestValidateObjectLockConfiguration(t *testing.T) { |
|
|
|
DefaultRetention: &DefaultRetention{ |
|
|
|
Mode: "INVALID_MODE", |
|
|
|
Days: 30, |
|
|
|
DaysSet: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -589,6 +594,7 @@ func TestValidateObjectLockConfiguration(t *testing.T) { |
|
|
|
DefaultRetention: &DefaultRetention{ |
|
|
|
Mode: "GOVERNANCE", |
|
|
|
Days: 50000, |
|
|
|
DaysSet: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -603,6 +609,7 @@ func TestValidateObjectLockConfiguration(t *testing.T) { |
|
|
|
DefaultRetention: &DefaultRetention{ |
|
|
|
Mode: "GOVERNANCE", |
|
|
|
Years: 200, |
|
|
|
YearsSet: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -653,6 +660,7 @@ func TestValidateDefaultRetention(t *testing.T) { |
|
|
|
retention: &DefaultRetention{ |
|
|
|
Mode: "GOVERNANCE", |
|
|
|
Days: 30, |
|
|
|
DaysSet: true, |
|
|
|
}, |
|
|
|
expectError: false, |
|
|
|
}, |
|
|
|
@ -661,6 +669,7 @@ func TestValidateDefaultRetention(t *testing.T) { |
|
|
|
retention: &DefaultRetention{ |
|
|
|
Mode: "COMPLIANCE", |
|
|
|
Years: 1, |
|
|
|
YearsSet: true, |
|
|
|
}, |
|
|
|
expectError: false, |
|
|
|
}, |
|
|
|
@ -668,6 +677,7 @@ func TestValidateDefaultRetention(t *testing.T) { |
|
|
|
name: "Missing mode", |
|
|
|
retention: &DefaultRetention{ |
|
|
|
Days: 30, |
|
|
|
DaysSet: true, |
|
|
|
}, |
|
|
|
expectError: true, |
|
|
|
errorMsg: "default retention must specify Mode", |
|
|
|
@ -677,6 +687,7 @@ func TestValidateDefaultRetention(t *testing.T) { |
|
|
|
retention: &DefaultRetention{ |
|
|
|
Mode: "INVALID", |
|
|
|
Days: 30, |
|
|
|
DaysSet: true, |
|
|
|
}, |
|
|
|
expectError: true, |
|
|
|
errorMsg: "invalid default retention mode", |
|
|
|
@ -687,6 +698,8 @@ func TestValidateDefaultRetention(t *testing.T) { |
|
|
|
Mode: "GOVERNANCE", |
|
|
|
Days: 30, |
|
|
|
Years: 1, |
|
|
|
DaysSet: true, |
|
|
|
YearsSet: true, |
|
|
|
}, |
|
|
|
expectError: true, |
|
|
|
errorMsg: "default retention cannot specify both Days and Years", |
|
|
|
|