From d362b45aa6d095309ace7d038ffe99fc4f7ff64a Mon Sep 17 00:00:00 2001 From: Anton Berezhnyi Date: Mon, 30 Sep 2024 22:46:42 -0400 Subject: [PATCH] Update packages --- ScoreChangedEventHandler_test.go | 16 ++++++++-------- go.mod | 2 +- go.sum | 2 ++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ScoreChangedEventHandler_test.go b/ScoreChangedEventHandler_test.go index 471ae02..85ab047 100644 --- a/ScoreChangedEventHandler_test.go +++ b/ScoreChangedEventHandler_test.go @@ -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" @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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(). @@ -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(). diff --git a/go.mod b/go.mod index 15c5602..5060632 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index fa11793..5b377bb 100644 --- a/go.sum +++ b/go.sum @@ -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=