Skip to content

Commit

Permalink
Update packages
Browse files Browse the repository at this point in the history
  • Loading branch information
berejant committed Oct 1, 2024
1 parent 998df69 commit d362b45
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
16 changes: 8 additions & 8 deletions ScoreChangedEventHandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/kneu-messenger-pigeon/client-framework/models"
"github.com/kneu-messenger-pigeon/events"
scoreApi "github.com/kneu-messenger-pigeon/score-api"
"github.com/kneu-messenger-pigeon/score-client"
scoreMocks "github.com/kneu-messenger-pigeon/score-client/mocks"
"github.com/redis/go-redis/v9"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
Expand Down Expand Up @@ -89,7 +89,7 @@ func TestScoreChangedEventHandler_Handle(t *testing.T) {
userRepository := mocks.NewUserRepositoryInterface(t)
userRepository.On("GetClientUserIds", event.StudentId).Return(chatIds)

scoreClient := score.NewMockClientInterface(t)
scoreClient := scoreMocks.NewClientInterface(t)
scoreClient.On("GetStudentScore", uint32(event.StudentId), int(event.DisciplineId), int(event.LessonId)).
Return(disciplineScore, nil)

Expand Down Expand Up @@ -195,7 +195,7 @@ func TestScoreChangedEventHandler_Handle(t *testing.T) {
userRepository := mocks.NewUserRepositoryInterface(t)
userRepository.On("GetClientUserIds", event.StudentId).Return(chatIds)

scoreClient := score.NewMockClientInterface(t)
scoreClient := scoreMocks.NewClientInterface(t)
scoreClient.On("GetStudentScore", uint32(event.StudentId), int(event.DisciplineId), int(event.LessonId)).Return(disciplineScore, nil)

scoreChangeEventComposer := mocks.NewScoreChangeEventComposerInterface(t)
Expand Down Expand Up @@ -301,7 +301,7 @@ func TestScoreChangedEventHandler_Handle(t *testing.T) {
userRepository := mocks.NewUserRepositoryInterface(t)
userRepository.On("GetClientUserIds", event.StudentId).Return(chatIds)

scoreClient := score.NewMockClientInterface(t)
scoreClient := scoreMocks.NewClientInterface(t)
scoreClient.On("GetStudentScore", uint32(event.StudentId), int(event.DisciplineId), int(event.LessonId)).Return(disciplineScore, nil)

scoreChangeEventComposer := mocks.NewScoreChangeEventComposerInterface(t)
Expand Down Expand Up @@ -413,7 +413,7 @@ func TestScoreChangedEventHandler_Handle(t *testing.T) {
userRepository := mocks.NewUserRepositoryInterface(t)
userRepository.On("GetClientUserIds", event.StudentId).Return(chatIds)

scoreClient := score.NewMockClientInterface(t)
scoreClient := scoreMocks.NewClientInterface(t)
scoreClient.On(
"GetStudentScore", uint32(event.StudentId), int(event.DisciplineId), int(event.LessonId),
).Return(disciplineScore, nil)
Expand Down Expand Up @@ -487,7 +487,7 @@ func TestScoreChangedEventHandler_Handle(t *testing.T) {
userRepository := mocks.NewUserRepositoryInterface(t)
userRepository.On("GetClientUserIds", event.StudentId).Return([]string{"test-chat-id-1"})

scoreClient := score.NewMockClientInterface(t)
scoreClient := scoreMocks.NewClientInterface(t)
scoreClient.On(
"GetStudentScore", uint32(event.StudentId), int(event.DisciplineId), int(event.LessonId),
).Return(scoreApi.DisciplineScore{}, expectedError)
Expand Down Expand Up @@ -600,7 +600,7 @@ func TestScoreChangedEventHandler_Handle(t *testing.T) {
userRepository := mocks.NewUserRepositoryInterface(t)
userRepository.On("GetClientUserIds", event.StudentId).Return([]string{"test-chat-id-1"})

scoreClient := score.NewMockClientInterface(t)
scoreClient := scoreMocks.NewClientInterface(t)
scoreClient.
On("GetStudentScore", uint32(event.StudentId), int(event.DisciplineId), int(event.LessonId)).
Once().
Expand Down Expand Up @@ -742,7 +742,7 @@ func TestScoreChangedEventHandler_Handle(t *testing.T) {
userRepository := mocks.NewUserRepositoryInterface(t)
userRepository.On("GetClientUserIds", event1.StudentId).Return(chatIds)

scoreClient := score.NewMockClientInterface(t)
scoreClient := scoreMocks.NewClientInterface(t)
scoreClient.
On("GetStudentScore", uint32(event1.StudentId), int(event1.DisciplineId), int(event1.LessonId)).
Once().
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/kneu-messenger-pigeon/authorizer-client v0.1.7
github.com/kneu-messenger-pigeon/events v0.1.41
github.com/kneu-messenger-pigeon/score-api v0.1.11
github.com/kneu-messenger-pigeon/score-client v0.1.12
github.com/kneu-messenger-pigeon/score-client v0.1.13
github.com/kneu-messenger-pigeon/victoria-metrics-init v0.1.3
github.com/redis/go-redis/v9 v9.6.1
github.com/segmentio/kafka-go v0.4.47
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ github.com/kneu-messenger-pigeon/score-api v0.1.11 h1:YZ3fKhJqHVCPXoqAT7BuWpxCve
github.com/kneu-messenger-pigeon/score-api v0.1.11/go.mod h1:xP8MpI8JaEeR7GUEWnq3p0meJ41Tz5+N+aRKNC4nRbM=
github.com/kneu-messenger-pigeon/score-client v0.1.12 h1:1IPxFOxJxd9Mr7dMvHS+wFIFY6UE0liHB3N6crjQUlM=
github.com/kneu-messenger-pigeon/score-client v0.1.12/go.mod h1:E8rYhhJQjRdiaKX2xNlRKwyETUHlGHz8DbjdVa+XyWs=
github.com/kneu-messenger-pigeon/score-client v0.1.13 h1:oaVZdp0raqXw1/GYJPdI7fivYNvZXbZGILZGolIex4w=
github.com/kneu-messenger-pigeon/score-client v0.1.13/go.mod h1:E8rYhhJQjRdiaKX2xNlRKwyETUHlGHz8DbjdVa+XyWs=
github.com/kneu-messenger-pigeon/victoria-metrics-init v0.1.3 h1:uqqgx7rA1WsHb0q9CZxI/hgop6VnXy1+KIz+sBqDRHs=
github.com/kneu-messenger-pigeon/victoria-metrics-init v0.1.3/go.mod h1:CpgTvzhSjL3E2ZkcI8sp+5Vp+kIsus/o1jC+EpoHeSc=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
Expand Down

0 comments on commit d362b45

Please sign in to comment.