From 3b343d1bd5e3adb9103c0e10fbdd67aa5aeb68ee Mon Sep 17 00:00:00 2001 From: Angira Kekteeva Date: Tue, 16 Aug 2022 12:19:56 +0400 Subject: [PATCH] [#634] Fix tests Signed-off-by: Angira Kekteeva --- api/layer/locking_test.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/api/layer/locking_test.go b/api/layer/locking_test.go index 59b9fb5..c9e0bb9 100644 --- a/api/layer/locking_test.go +++ b/api/layer/locking_test.go @@ -18,22 +18,24 @@ func TestObjectLockAttributes(t *testing.T) { obj := tc.putObject([]byte("content obj1 v1")) - p := &ObjectVersion{ - BktInfo: tc.bktInfo, - ObjectName: obj.Name, - VersionID: obj.VersionID(), - } - - lock := &data.ObjectLock{ - Retention: &data.RetentionLock{ - Until: time.Now(), + p := &PutLockInfoParams{ + ObjVersion: &ObjectVersion{ + BktInfo: tc.bktInfo, + ObjectName: obj.Name, + VersionID: obj.VersionID(), }, + NewLock: &data.ObjectLock{ + Retention: &data.RetentionLock{ + Until: time.Now(), + }, + }, + CopiesNumber: 0, } - err = tc.layer.PutLockInfo(tc.ctx, p, lock) + err = tc.layer.PutLockInfo(tc.ctx, p) require.NoError(t, err) - foundLock, err := tc.layer.GetLockInfo(tc.ctx, p) + foundLock, err := tc.layer.GetLockInfo(tc.ctx, p.ObjVersion) require.NoError(t, err) lockObj := tc.getObjectByID(foundLock.Retention())