Skip to content

feat: Account Management#6

Merged
janosevicsm merged 9 commits intodevelopfrom
feature/account-management
Feb 11, 2026
Merged

feat: Account Management#6
janosevicsm merged 9 commits intodevelopfrom
feature/account-management

Conversation

@janosevicsm
Copy link
Contributor

Created account management endpoints in User Controller/Service.
Modified User to extend BaseEntity class.
Added Unit tests for related features.

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.
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.
@janosevicsm janosevicsm requested a review from cuturic01 February 8, 2026 22:58
@janosevicsm janosevicsm self-assigned this Feb 8, 2026
@lukaDjordjevic01 lukaDjordjevic01 removed the request for review from cuturic01 February 11, 2026 18:01
@janosevicsm janosevicsm force-pushed the feature/account-management branch from 3ee389c to f591854 Compare February 11, 2026 18:07
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.
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.
@sonarqubecloud
Copy link

@janosevicsm janosevicsm merged commit f75e41a into develop Feb 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments