Skip to content

Commit d2cd603

Browse files
modify test
1 parent 475955b commit d2cd603

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

modules/msp/apm/alert/alert.service_test.go

+11-15
Original file line numberDiff line numberDiff line change
@@ -311,18 +311,10 @@ func Test_alertService_GetAlertConditionsValue(t *testing.T) {
311311
defer ctrl.Finish()
312312
monitorService := NewMockAlertServiceServer(ctrl)
313313
monitorService.EXPECT().GetAlertConditionsValue(gomock.Any(), gomock.Any()).AnyTimes().Return(&monitor.GetAlertConditionsValueResponse{
314-
Data: []*monitor.AlertConditionsValue{
315-
{
316-
Key: "application_name",
317-
Options: []*structpb.Value{
318-
structpb.NewStringValue("go-demo"),
319-
},
320-
},
321-
{
322-
Key: "service_name",
323-
Options: []*structpb.Value{
324-
structpb.NewStringValue("go-demo"),
325-
},
314+
Data: &monitor.AlertConditionsValue{
315+
Key: "application-name",
316+
Options: []*structpb.Value{
317+
structpb.NewStringValue("erda"),
326318
},
327319
},
328320
}, nil)
@@ -341,9 +333,13 @@ func Test_alertService_GetAlertConditionsValue(t *testing.T) {
341333
}
342334
pro.alertService.p = pro
343335
_, err := pro.alertService.GetAlertConditionsValue(context.Background(), &pb.GetAlertConditionsValueRequest{
344-
ProjectId: "3",
345-
TerminusKey: "3013939450553395c209ec92d1dda84a",
346-
ScopeType: "msp",
336+
Condition: "application-name",
337+
Filters: map[string]string{
338+
"org_name": "erda",
339+
"project_id": "12",
340+
"terminus_key": "c393550824b3d50aa758fee4593d6e31",
341+
},
342+
Index: "application_service_node",
347343
})
348344
if err != nil {
349345
fmt.Println("should not err,err is ", err)

0 commit comments

Comments
 (0)