From da29d921359b2932d56b16cfa4440721fb413c1f Mon Sep 17 00:00:00 2001 From: foghost Date: Fri, 5 Jan 2024 15:59:08 +0800 Subject: [PATCH] fix unit test --- metadata/report/nacos/report_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metadata/report/nacos/report_test.go b/metadata/report/nacos/report_test.go index 759a456614..3d87eaa2ec 100644 --- a/metadata/report/nacos/report_test.go +++ b/metadata/report/nacos/report_test.go @@ -212,7 +212,7 @@ func Test_nacosMetadataReport_GetAppMetadata(t *testing.T) { ctrl := gomock.NewController(t) mnc := NewMockIConfigClient(ctrl) - mnc.EXPECT().GetConfig(gomock.Any()).Return(string(data), nil) + mnc.EXPECT().GetConfig(gomock.Any()).MaxTimes(2).Return(string(data), nil) nc := &nacosClient.NacosConfigClient{} nc.SetClient(mnc) @@ -253,7 +253,7 @@ func Test_nacosMetadataReport_GetAppMetadata(t *testing.T) { func Test_nacosMetadataReport_PublishAppMetadata(t *testing.T) { ctrl := gomock.NewController(t) mnc := NewMockIConfigClient(ctrl) - mnc.EXPECT().PublishConfig(gomock.Any()).Return(true, nil) + mnc.EXPECT().PublishConfig(gomock.Any()).Times(2).Return(true, nil) nc := &nacosClient.NacosConfigClient{} nc.SetClient(mnc)