Skip to content

Commit

Permalink
[api] impl. TestGrpcServer_GetServerMeta (#3559)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daulet Dulanov authored Jul 19, 2022
1 parent 7783ced commit 8d1e836
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions api/grpcserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8d1e836

Please sign in to comment.