Skip to content

feat: Add UserPublicController and unit tests#11

Open
janosevicsm wants to merge 1 commit intodevelopfrom
feature/user-public
Open

feat: Add UserPublicController and unit tests#11
janosevicsm wants to merge 1 commit intodevelopfrom
feature/user-public

Conversation

@janosevicsm
Copy link
Contributor

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.

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.
@janosevicsm janosevicsm self-assigned this Feb 18, 2026
@sonarqubecloud
Copy link

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