diff --git a/handler.go b/handler.go index 49dbd71c..300b3f9b 100644 --- a/handler.go +++ b/handler.go @@ -42,6 +42,7 @@ func IsHandlerEqual(a, b Handler) bool { return a.Identity() == b.Identity() && a.TypeName() == b.TypeName() && a.HandlerType() == b.HandlerType() && + a.IsDisabled() == b.IsDisabled() && a.MessageNames().IsEqual(b.MessageNames()) } diff --git a/handler_test.go b/handler_test.go index 13b3e171..576e14b6 100644 --- a/handler_test.go +++ b/handler_test.go @@ -85,6 +85,20 @@ var _ = Describe("func IsHandlerEqual()", func() { }, }), ), + Entry( + "disabled state differs", + FromAggregate(&fixtures.AggregateMessageHandler{ + ConfigureFunc: func(c dogma.AggregateConfigurer) { + c.Identity("", aggregateKey) + c.Routes( + dogma.HandlesCommand[fixtures.MessageA](), + dogma.HandlesCommand[fixtures.MessageB](), + dogma.RecordsEvent[fixtures.MessageE](), + ) + c.Disable() + }, + }), + ), Entry( "messages differ", FromAggregate(&fixtures.AggregateMessageHandler{