mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Replace AddHandler with AddHandlerCtx in tests (#42585)
This commit is contained in:
@@ -18,7 +18,7 @@ func TestDispatch(t *testing.T) {
|
||||
|
||||
var invoked bool
|
||||
|
||||
bus.AddHandler(func(query *testQuery) error {
|
||||
bus.AddHandlerCtx(func(ctx context.Context, query *testQuery) error {
|
||||
invoked = true
|
||||
return nil
|
||||
})
|
||||
@@ -74,7 +74,7 @@ func TestDispatchCtx_NoContextHandler(t *testing.T) {
|
||||
|
||||
var invoked bool
|
||||
|
||||
bus.AddHandler(func(query *testQuery) error {
|
||||
bus.AddHandlerCtx(func(ctx context.Context, query *testQuery) error {
|
||||
invoked = true
|
||||
return nil
|
||||
})
|
||||
@@ -98,7 +98,7 @@ func TestQuery(t *testing.T) {
|
||||
|
||||
want := "hello from handler"
|
||||
|
||||
bus.AddHandler(func(q *testQuery) error {
|
||||
bus.AddHandlerCtx(func(ctx context.Context, q *testQuery) error {
|
||||
q.Resp = want
|
||||
return nil
|
||||
})
|
||||
@@ -114,7 +114,7 @@ func TestQuery(t *testing.T) {
|
||||
func TestQuery_HandlerReturnsError(t *testing.T) {
|
||||
bus := New()
|
||||
|
||||
bus.AddHandler(func(query *testQuery) error {
|
||||
bus.AddHandlerCtx(func(ctx context.Context, query *testQuery) error {
|
||||
return errors.New("handler error")
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user