From fdfb5141f4a9978f31ed96bc39748b8c44eb10e9 Mon Sep 17 00:00:00 2001 From: evgeniy-scherbina <evgeniy.shcherbina.es@gmail.com> Date: Tue, 10 Oct 2023 09:41:07 -0400 Subject: [PATCH] TMP Commit --- service/cachemdw/cache_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/service/cachemdw/cache_test.go b/service/cachemdw/cache_test.go index 26082da..61f9de6 100644 --- a/service/cachemdw/cache_test.go +++ b/service/cachemdw/cache_test.go @@ -23,7 +23,8 @@ const ( ) var ( - defaultChainID = big.NewInt(1) + defaultChainID = big.NewInt(1) + defaultQueryResp = []byte("resp") ) type MockEVMClient struct{} @@ -83,12 +84,12 @@ func TestUnitTestCacheQueryResponse(t *testing.T) { require.Equal(t, cache.ErrNotFound, err) require.Empty(t, resp) - err = serviceCache.CacheQueryResponse(context.Background(), req, defaultChainIDString, []byte("resp")) + err = serviceCache.CacheQueryResponse(context.Background(), req, defaultChainIDString, defaultQueryResp) require.NoError(t, err) resp, err = serviceCache.GetCachedQueryResponse(context.Background(), req, defaultHost) require.NoError(t, err) - require.Equal(t, []byte("resp"), resp) + require.Equal(t, defaultQueryResp, resp) } func TestUnitTestValidateAndCacheQueryResponse(t *testing.T) { @@ -106,12 +107,12 @@ func TestUnitTestValidateAndCacheQueryResponse(t *testing.T) { require.Equal(t, cache.ErrNotFound, err) require.Empty(t, resp) - err = serviceCache.ValidateAndCacheQueryResponse(context.Background(), req, defaultHost, []byte("resp")) + err = serviceCache.ValidateAndCacheQueryResponse(context.Background(), req, defaultHost, defaultQueryResp) require.NoError(t, err) resp, err = serviceCache.GetCachedQueryResponse(context.Background(), req, defaultHost) require.NoError(t, err) - require.Equal(t, []byte("resp"), resp) + require.Equal(t, defaultQueryResp, resp) } func TestUnitTestGetCachedChainID(t *testing.T) {