fix(fmt): formatting
This commit is contained in:
@@ -182,4 +182,3 @@ func TestGateway_matchRoute(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -239,4 +239,3 @@ func joinHash(parts []string) string {
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user