[VOL-3069]Pass Context in methods which are performing logging and need the context
Change-Id: I3d9e1c3eff95d60dde46d44d16bed4805f7447f5
diff --git a/pkg/adapters/common/utils_test.go b/pkg/adapters/common/utils_test.go
index 87594fd..a93dd2f 100644
--- a/pkg/adapters/common/utils_test.go
+++ b/pkg/adapters/common/utils_test.go
@@ -16,6 +16,7 @@
package common
import (
+ "context"
ic "github.com/opencord/voltha-protos/v3/go/inter_container"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc/codes"
@@ -72,12 +73,12 @@
}
func TestICProxyErrorCodeToGrpcErrorCode(t *testing.T) {
- unsupported := ICProxyErrorCodeToGrpcErrorCode(ic.ErrorCode_UNSUPPORTED_REQUEST)
+ unsupported := ICProxyErrorCodeToGrpcErrorCode(context.Background(), ic.ErrorCode_UNSUPPORTED_REQUEST)
assert.Equal(t, unsupported, codes.Unavailable)
- invalid := ICProxyErrorCodeToGrpcErrorCode(ic.ErrorCode_INVALID_PARAMETERS)
+ invalid := ICProxyErrorCodeToGrpcErrorCode(context.Background(), ic.ErrorCode_INVALID_PARAMETERS)
assert.Equal(t, invalid, codes.InvalidArgument)
- timeout := ICProxyErrorCodeToGrpcErrorCode(ic.ErrorCode_DEADLINE_EXCEEDED)
+ timeout := ICProxyErrorCodeToGrpcErrorCode(context.Background(), ic.ErrorCode_DEADLINE_EXCEEDED)
assert.Equal(t, timeout, codes.DeadlineExceeded)
}