diff --git a/common/actions_test.go b/common/actions_test.go index e65c0e87..e35d0b5a 100644 --- a/common/actions_test.go +++ b/common/actions_test.go @@ -179,3 +179,27 @@ func TestPreDeleteAction(t *testing.T) { Config.Actions = actionsCopy } + +type actionHandlerStub struct { + called bool +} + +func (h *actionHandlerStub) Handle(notification ActionNotification) error { + h.called = true + + return nil +} + +func TestInitializeActionHandler(t *testing.T) { + handler := &actionHandlerStub{} + + InitializeActionHandler(handler) + t.Cleanup(func() { + InitializeActionHandler(defaultActionHandler{}) + }) + + err := actionHandler.Handle(ActionNotification{}) + + assert.NoError(t, err) + assert.True(t, handler.called) +}