diff --git a/api/cache/cache_test.go b/api/cache/cache_test.go index 679b491b..3d46ad79 100644 --- a/api/cache/cache_test.go +++ b/api/cache/cache_test.go @@ -71,15 +71,26 @@ func TestObjectCacheType(t *testing.T) { cache := New(DefaultObjectsConfig(logger)) addr := oidtest.Address() - objInfo := &data.ObjectInfo{ - ID: addr.Object(), - CID: addr.Container(), + + extObjInfo := &data.ExtendedObjectInfo{ + ObjectInfo: &data.ObjectInfo{ + ID: addr.Object(), + CID: addr.Container(), + }, + NodeVersion: &data.NodeVersion{ + BaseNodeVersion: data.BaseNodeVersion{ + FilePath: "obj", + Size: 50, + }, + IsUnversioned: true, + }, + IsLatest: true, } - err := cache.PutObject(objInfo) + err := cache.PutObject(extObjInfo) require.NoError(t, err) val := cache.GetObject(addr) - require.Equal(t, objInfo, val) + require.Equal(t, extObjInfo, val) require.Equal(t, 0, observedLog.Len()) err = cache.cache.Set(addr, "tmp") diff --git a/api/cache/objects_test.go b/api/cache/objects_test.go index ab53617d..9e63a2c3 100644 --- a/api/cache/objects_test.go +++ b/api/cache/objects_test.go @@ -28,23 +28,33 @@ func TestCache(t *testing.T) { addr.SetContainer(cnrID) addr.SetObject(objID) - objInfo := &data.ObjectInfo{ - ID: addr.Object(), - CID: addr.Container(), + extObjInfo := &data.ExtendedObjectInfo{ + ObjectInfo: &data.ObjectInfo{ + ID: addr.Object(), + CID: addr.Container(), + }, + NodeVersion: &data.NodeVersion{ + BaseNodeVersion: data.BaseNodeVersion{ + FilePath: "obj", + Size: 50, + }, + IsUnversioned: true, + }, + IsLatest: true, } t.Run("check get", func(t *testing.T) { cache := New(getTestConfig()) - err := cache.PutObject(objInfo) + err := cache.PutObject(extObjInfo) require.NoError(t, err) actual := cache.GetObject(addr) - require.Equal(t, objInfo, actual) + require.Equal(t, extObjInfo, actual) }) t.Run("check delete", func(t *testing.T) { cache := New(getTestConfig()) - err := cache.PutObject(objInfo) + err := cache.PutObject(extObjInfo) require.NoError(t, err) cache.Delete(addr)