From 7c0aefb7f419200b7f6c6a5264686ba855b1ea6c Mon Sep 17 00:00:00 2001 From: 0x1d Date: Fri, 7 Nov 2025 09:10:22 +0100 Subject: [PATCH] fix(fmt): formatting --- internal/client/grpc/identity_client.go | 2 +- services/gateway/gateway_helpers_test.go | 1 - services/gateway/gateway_test.go | 28 ++++++++-------- services/gateway/handlers_test.go | 33 +++++++++---------- .../internal/password/password_test.go | 1 - 5 files changed, 31 insertions(+), 34 deletions(-) diff --git a/internal/client/grpc/identity_client.go b/internal/client/grpc/identity_client.go index 7d6a094..c0d5836 100644 --- a/internal/client/grpc/identity_client.go +++ b/internal/client/grpc/identity_client.go @@ -204,7 +204,7 @@ func (c *IdentityClient) VerifyPassword(ctx context.Context, email, password str resp, err := c.client.VerifyPassword(ctx, &identityv1.VerifyPasswordRequest{ Email: email, - Password: password, + Password: password, }) if err != nil { return nil, fmt.Errorf("verify password failed: %w", err) diff --git a/services/gateway/gateway_helpers_test.go b/services/gateway/gateway_helpers_test.go index 49c1d96..a3d4387 100644 --- a/services/gateway/gateway_helpers_test.go +++ b/services/gateway/gateway_helpers_test.go @@ -182,4 +182,3 @@ func TestGateway_matchRoute(t *testing.T) { }) } } - diff --git a/services/gateway/gateway_test.go b/services/gateway/gateway_test.go index 174f3b4..cbacc6f 100644 --- a/services/gateway/gateway_test.go +++ b/services/gateway/gateway_test.go @@ -456,20 +456,20 @@ func (m *mockAuthClient) Logout(ctx context.Context, refreshToken string) error // mockIdentityClient implements services.IdentityServiceClient for testing. type mockIdentityClient struct { - getUserResp *services.User - getUserErr error - getUserByEmailResp *services.User - getUserByEmailErr error - createUserResp *services.User - createUserErr error - updateUserResp *services.User - updateUserErr error - deleteUserErr error - verifyEmailErr error - requestPasswordResetErr error - resetPasswordErr error - verifyPasswordResp *services.User - verifyPasswordErr error + getUserResp *services.User + getUserErr error + getUserByEmailResp *services.User + getUserByEmailErr error + createUserResp *services.User + createUserErr error + updateUserResp *services.User + updateUserErr error + deleteUserErr error + verifyEmailErr error + requestPasswordResetErr error + resetPasswordErr error + verifyPasswordResp *services.User + verifyPasswordErr error } func (m *mockIdentityClient) GetUser(ctx context.Context, id string) (*services.User, error) { diff --git a/services/gateway/handlers_test.go b/services/gateway/handlers_test.go index 415000f..227c2d0 100644 --- a/services/gateway/handlers_test.go +++ b/services/gateway/handlers_test.go @@ -61,7 +61,7 @@ func TestGateway_handleLogin(t *testing.T) { name: "client error - unauthorized", requestBody: map[string]string{ "email": "test@example.com", - "password": "wrongpassword", + "password": "wrongpassword", }, clientErr: status.Error(codes.Unauthenticated, "invalid credentials"), expectedStatus: http.StatusUnauthorized, @@ -70,7 +70,7 @@ func TestGateway_handleLogin(t *testing.T) { name: "client error - internal", requestBody: map[string]string{ "email": "test@example.com", - "password": "password123", + "password": "password123", }, clientErr: status.Error(codes.Internal, "internal error"), expectedStatus: http.StatusInternalServerError, @@ -132,7 +132,7 @@ func TestGateway_handleRefreshToken(t *testing.T) { expectedStatus: http.StatusOK, }, { - name: "invalid request body", + name: "invalid request body", requestBody: map[string]string{ // missing refresh_token }, @@ -200,7 +200,7 @@ func TestGateway_handleValidateToken(t *testing.T) { expectedStatus: http.StatusOK, }, { - name: "invalid request body", + name: "invalid request body", requestBody: map[string]string{ // missing token }, @@ -261,7 +261,7 @@ func TestGateway_handleLogout(t *testing.T) { expectedStatus: http.StatusOK, }, { - name: "invalid request body", + name: "invalid request body", requestBody: map[string]string{ // missing refresh_token }, @@ -316,11 +316,11 @@ func TestGateway_handleGetUser(t *testing.T) { }{ { name: "successful get user", - userID: "user-123", + userID: "user-123", clientResp: &services.User{ ID: "user-123", Email: "test@example.com", - Username: "testuser", + Username: "testuser", FirstName: "Test", LastName: "User", }, @@ -374,31 +374,31 @@ func TestGateway_handleCreateUser(t *testing.T) { name: "successful create", requestBody: services.CreateUserRequest{ Email: "test@example.com", - Username: "testuser", - Password: "password123", - FirstName: "Test", - LastName: "User", + Username: "testuser", + Password: "password123", + FirstName: "Test", + LastName: "User", }, clientResp: &services.User{ ID: "user-123", Email: "test@example.com", - Username: "testuser", + Username: "testuser", FirstName: "Test", LastName: "User", }, expectedStatus: http.StatusCreated, }, { - name: "invalid JSON", - requestBody: "not a json object", + name: "invalid JSON", + requestBody: "not a json object", expectedStatus: http.StatusBadRequest, }, { name: "client error - already exists", requestBody: services.CreateUserRequest{ Email: "existing@example.com", - Username: "existing", - Password: "password123", + Username: "existing", + Password: "password123", }, clientErr: status.Error(codes.AlreadyExists, "user already exists"), expectedStatus: http.StatusConflict, @@ -517,4 +517,3 @@ func TestGateway_handleGRPCError(t *testing.T) { }) } } - diff --git a/services/identity/internal/password/password_test.go b/services/identity/internal/password/password_test.go index fa831e9..7886eb9 100644 --- a/services/identity/internal/password/password_test.go +++ b/services/identity/internal/password/password_test.go @@ -239,4 +239,3 @@ func joinHash(parts []string) string { } return result } -