Skip to content

Commit

Permalink
fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
kopaygorodsky committed Jul 9, 2024
1 parent 920eed3 commit 57c5c30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions saga/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,28 @@ type sagaCtx struct {
deliveries []*Delivery
}

func (s sagaCtx) Message() *message.ReceivedMessage {
func (s *sagaCtx) Message() *message.ReceivedMessage {
return s.execCtx.Message()
}

func (s sagaCtx) Context() context.Context {
func (s *sagaCtx) Context() context.Context {
return s.execCtx.Context()
}

func (s sagaCtx) Valid() bool {
func (s *sagaCtx) Valid() bool {
return s.execCtx.Valid()
}

func (s sagaCtx) Return(options ...endpoint.DeliveryOption) error {
func (s *sagaCtx) Return(options ...endpoint.DeliveryOption) error {
s.Logger().Log(log.InfoLevel, "returning saga event")
return s.execCtx.Return(options...)
}

func (s sagaCtx) Logger() log.Logger {
func (s *sagaCtx) Logger() log.Logger {
return s.logger
}

func (s sagaCtx) SagaInstance() Instance {
func (s *sagaCtx) SagaInstance() Instance {
return s.sagaInstance
}

Expand All @@ -69,7 +69,7 @@ func (s *sagaCtx) Dispatch(toDeliver message.Object, options ...endpoint.Deliver
})
}

func (s sagaCtx) Deliveries() []*Delivery {
func (s *sagaCtx) Deliveries() []*Delivery {
return s.deliveries
}

Expand Down
2 changes: 1 addition & 1 deletion saga/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestSagaContext(t *testing.T) {
msgExecCtxMock.EXPECT().Context().Return(runningCtx)

ctx := sagaCtx.Context()
assert.Same(t, ctx, runningCtx)
assert.Equal(t, ctx, runningCtx)
assert.Same(t, loggerMock, sagaCtx.Logger())

msgExecCtxMock.EXPECT().Valid().Return(true)
Expand Down

0 comments on commit 57c5c30

Please sign in to comment.