Conversation
Added logstash-logback-encoder dependency and configured Logback for structured logging to Logstash. Enhanced TestController with MDC and logging statements. Updated application properties for logging settings and added Logback configuration files for main and test environments.
…ntegration feat: Add zipkin tracing
* feat: Add user profile APIs, soft-delete support Introduce user profile endpoints and related service/DTO/entity changes. Adds UserController (/api/user/me) with GET, PUT and password update endpoints guarded by roles; new request DTOs UpdateUserRequest and ChangePasswordRequest with validation. Introduce BaseEntity (UUID id, createdAt, updatedAt, isDeleted) and update User to extend it; apply SQL restriction to exclude soft-deleted users and update mapper to ignore isDeleted. Add UserService implementing getProfile, updateProfile (checks for username/email conflicts, persists changes and returns refreshed JWT) and changePassword (validates current password). Add UserNotFoundException and register handler in GlobalExceptionHandler. Add Flyway migration V2 to add is_deleted column to users table. * feat: Add unit tests for UserController and UserService Introduce comprehensive JUnit tests for user controller and service layers. Adds UserControllerTest (MockMvc tests covering getProfile, updateProfile and changePassword with success and error cases, including exception handling via GlobalExceptionHandler) and UserServiceTest (unit tests for getProfile, updateProfile and changePassword covering success paths, validation, and exceptions like UserAlreadyExistsException, InvalidCredentialsException, and UserNotFoundException). Tests use Mockito to mock dependencies and verify behavior and side effects. * fix: Modified changePassword to use new InvalidPasswordException that returns 400 instead of 401 * feat: Add user profile APIs, soft-delete support Introduce user profile endpoints and related service/DTO/entity changes. Adds UserController (/api/user/me) with GET, PUT and password update endpoints guarded by roles; new request DTOs UpdateUserRequest and ChangePasswordRequest with validation. Introduce BaseEntity (UUID id, createdAt, updatedAt, isDeleted) and update User to extend it; apply SQL restriction to exclude soft-deleted users and update mapper to ignore isDeleted. Add UserService implementing getProfile, updateProfile (checks for username/email conflicts, persists changes and returns refreshed JWT) and changePassword (validates current password). Add UserNotFoundException and register handler in GlobalExceptionHandler. Add Flyway migration V2 to add is_deleted column to users table. * feat: Add unit tests for UserController and UserService Introduce comprehensive JUnit tests for user controller and service layers. Adds UserControllerTest (MockMvc tests covering getProfile, updateProfile and changePassword with success and error cases, including exception handling via GlobalExceptionHandler) and UserServiceTest (unit tests for getProfile, updateProfile and changePassword covering success paths, validation, and exceptions like UserAlreadyExistsException, InvalidCredentialsException, and UserNotFoundException). Tests use Mockito to mock dependencies and verify behavior and side effects. * fix: Modified changePassword to use new InvalidPasswordException that returns 400 instead of 401 * fix: Jacoco in pipeline * fix: Dsonar.sources in pipeline
Introduce UserPublicController with GET /api/user/{id} endpoint that returns a UserResponse via UserService.getProfile(UUID) and is protected by @RequireRole({"HOST","GUEST"}). Add comprehensive unit tests (UserPublicControllerTest) using MockMvc to cover successful access for HOST and GUEST, missing auth headers (401), forbidden role (403), and user-not-found mapping to 404 via GlobalExceptionHandler. Tests configure UserContextResolver and RoleAuthorizationInterceptor to simulate request context and authorization.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



No description provided.