Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jcieslak committed Oct 26, 2023
1 parent 6be3435 commit 41961ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/sdk/resource_monitors.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ func (opts *AlterResourceMonitorOptions) validate() error {
errs = append(errs, errors.New("must specify frequency and start time together"))
}
}
if !exactlyOneValueSet(opts.Set, opts.NotifyUsers) && opts.Triggers == nil {
errs = append(errs, errExactlyOneOf("AlterResourceMonitorOptions", "Set", "NotifyUsers", "Triggers"))
}
return errors.Join(errs...)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/resource_monitors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func TestResourceMonitorAlter(t *testing.T) {
opts := &AlterResourceMonitorOptions{
name: id,
}
assertOptsInvalidJoinedErrors(t, opts, errNotSet("AlterResourceMonitorOptions", "Set"))
assertOptsInvalidJoinedErrors(t, opts, errExactlyOneOf("AlterResourceMonitorOptions", "Set", "NotifyUsers", "Triggers"))
})

t.Run("with a single set", func(t *testing.T) {
Expand Down

0 comments on commit 41961ed

Please sign in to comment.