Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
evlekht committed Nov 22, 2024
1 parent 6d4e630 commit 3db00a4
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions internal/messaging/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var (
}
)

func TestProcessInbound(t *testing.T) {
func TestProcessIncomingMessage(t *testing.T) {
responseMessage := types.Message{
Type: generated.PingServiceV1Response,
Metadata: metadata.Metadata{
Expand Down Expand Up @@ -113,13 +113,6 @@ func TestProcessInbound(t *testing.T) {
},
err: ErrUnsupportedService,
},
"ignore own outbound messages": {
fields: fields{},
args: args{
msg: &types.Message{Metadata: metadata.Metadata{}, Sender: userID},
},
err: nil, // no error, msg will be just ignored
},
"err: process request message failed": {
fields: fields{
serviceRegistry: mockServiceRegistry,
Expand Down Expand Up @@ -304,7 +297,7 @@ func TestSendRequestMessage(t *testing.T) {
},
},
prepare: func() {
mockCMAccounts.EXPECT().GetChequeOperators(gomock.Any(), gomock.Any()).Return([]common.Address{{}}, nil)
mockCMAccounts.EXPECT().GetFirstChequeOperator(gomock.Any(), gomock.Any()).Return(common.Address{}, nil)
mockCMAccounts.EXPECT().GetServiceFee(gomock.Any(), gomock.Any(), gomock.Any()).Return(big.NewInt(1), nil)
mockCMAccounts.EXPECT().IsBotAllowed(gomock.Any(), gomock.Any(), gomock.Any()).Return(true, nil)
mockChequeHandler.EXPECT().IssueCheque(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Times(2).Return(&cheques.SignedCheque{}, nil)
Expand All @@ -329,8 +322,7 @@ func TestSendRequestMessage(t *testing.T) {
},
},
prepare: func() {
mockCMAccounts.EXPECT().GetChequeOperators(gomock.Any(), gomock.Any()).
Return([]common.Address{{}}, nil)
mockCMAccounts.EXPECT().GetFirstChequeOperator(gomock.Any(), gomock.Any()).Return(common.Address{}, nil)
mockCMAccounts.EXPECT().GetServiceFee(gomock.Any(), gomock.Any(), gomock.Any()).
Return(big.NewInt(1), nil)
mockCMAccounts.EXPECT().IsBotAllowed(gomock.Any(), gomock.Any(), gomock.Any()).Return(true, nil)
Expand All @@ -357,7 +349,7 @@ func TestSendRequestMessage(t *testing.T) {
},
},
prepare: func() {
mockCMAccounts.EXPECT().GetChequeOperators(gomock.Any(), gomock.Any()).Return([]common.Address{{}}, nil)
mockCMAccounts.EXPECT().GetFirstChequeOperator(gomock.Any(), gomock.Any()).Return(common.Address{}, nil)
mockCMAccounts.EXPECT().GetServiceFee(gomock.Any(), gomock.Any(), gomock.Any()).Return(big.NewInt(1), nil)
mockCMAccounts.EXPECT().IsBotAllowed(gomock.Any(), gomock.Any(), gomock.Any()).Return(true, nil)
mockMessenger.EXPECT().SendAsync(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil)
Expand Down

0 comments on commit 3db00a4

Please sign in to comment.