refactor!(notifications): drop URM and Org services from NotificationRuleService interface definition (#18131)
parent
876a89a348
commit
0186fed3ce
|
@ -35,12 +35,6 @@ type NotificationRule interface {
|
||||||
|
|
||||||
// NotificationRuleStore represents a service for managing notification rule.
|
// NotificationRuleStore represents a service for managing notification rule.
|
||||||
type NotificationRuleStore interface {
|
type NotificationRuleStore interface {
|
||||||
// UserResourceMappingService must be part of all NotificationRuleStore service,
|
|
||||||
// for create, search, delete.
|
|
||||||
UserResourceMappingService
|
|
||||||
// OrganizationService is needed for search filter
|
|
||||||
OrganizationService
|
|
||||||
|
|
||||||
// FindNotificationRuleByID returns a single notification rule by ID.
|
// FindNotificationRuleByID returns a single notification rule by ID.
|
||||||
FindNotificationRuleByID(ctx context.Context, id ID) (NotificationRule, error)
|
FindNotificationRuleByID(ctx context.Context, id ID) (NotificationRule, error)
|
||||||
|
|
||||||
|
|
|
@ -346,14 +346,6 @@ func CreateNotificationRule(
|
||||||
if diff := cmp.Diff(nrs, tt.wants.notificationRules, notificationRuleCmpOptions...); diff != "" {
|
if diff := cmp.Diff(nrs, tt.wants.notificationRules, notificationRuleCmpOptions...); diff != "" {
|
||||||
t.Errorf("notificationRules are different -got/+want\ndiff %s", diff)
|
t.Errorf("notificationRules are different -got/+want\ndiff %s", diff)
|
||||||
}
|
}
|
||||||
|
|
||||||
urms, _, err := s.FindUserResourceMappings(ctx, urmFilter)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("failed to retrieve user resource mappings: %v", err)
|
|
||||||
}
|
|
||||||
if diff := cmp.Diff(urms, tt.wants.userResourceMapping, userResourceMappingCmpOptions...); diff != "" {
|
|
||||||
t.Errorf("user resource mappings are different -got/+want\ndiff %s", diff)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2710,17 +2702,6 @@ func DeleteNotificationRule(
|
||||||
if diff := cmp.Diff(nrs, tt.wants.notificationRules, notificationRuleCmpOptions...); diff != "" {
|
if diff := cmp.Diff(nrs, tt.wants.notificationRules, notificationRuleCmpOptions...); diff != "" {
|
||||||
t.Errorf("notification rules are different -got/+want\ndiff %s", diff)
|
t.Errorf("notification rules are different -got/+want\ndiff %s", diff)
|
||||||
}
|
}
|
||||||
|
|
||||||
urms, _, err := s.FindUserResourceMappings(ctx, influxdb.UserResourceMappingFilter{
|
|
||||||
UserID: tt.args.userID,
|
|
||||||
ResourceType: influxdb.NotificationRuleResourceType,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("failed to retrieve user resource mappings: %v", err)
|
|
||||||
}
|
|
||||||
if diff := cmp.Diff(urms, tt.wants.userResourceMappings, userResourceMappingCmpOptions...); diff != "" {
|
|
||||||
t.Errorf("user resource mappings are different -got/+want\ndiff %s", diff)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue