From ef20fa79713671ef5580176b7e4fa1bd14c77187 Mon Sep 17 00:00:00 2001 From: Daulet Dulanov Date: Sun, 17 Jul 2022 16:17:19 +0000 Subject: [PATCH] [api] impl. TestGrpcServer_GetServerMeta --- api/grpcserver_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/api/grpcserver_test.go b/api/grpcserver_test.go index 91b0c280f9..684304a456 100644 --- a/api/grpcserver_test.go +++ b/api/grpcserver_test.go @@ -104,7 +104,20 @@ func TestGrpcServer_GetReceiptByAction(t *testing.T) { } func TestGrpcServer_GetServerMeta(t *testing.T) { + require := require.New(t) + ctrl := gomock.NewController(t) + defer ctrl.Finish() + core := mock_apicoreservice.NewMockCoreService(ctrl) + grpcSvr := newGRPCHandler(core) + core.EXPECT().ServerMeta().Return("packageVersion", "packageCommitID", "gitStatus", "goVersion", "buildTime") + res, err := grpcSvr.GetServerMeta(context.Background(), &iotexapi.GetServerMetaRequest{}) + require.NoError(err) + require.Equal("packageVersion", res.ServerMeta.PackageVersion) + require.Equal("packageCommitID", res.ServerMeta.PackageCommitID) + require.Equal("gitStatus", res.ServerMeta.GitStatus) + require.Equal("goVersion", res.ServerMeta.GoVersion) + require.Equal("buildTime", res.ServerMeta.BuildTime) } func TestGrpcServer_ReadContract(t *testing.T) {