| Type |
Bug
|
| Priority |
Normal
|
| Assignee | |
| Version |
1.0
|
| Sprints |
n/a
|
| Customer |
n/a
|
Issue Votes (0)
| Type |
Bug
|
| Priority |
Normal
|
| Assignee | |
| Version |
1.0
|
| Sprints |
n/a
|
| Customer |
n/a
|
Scope:
Multiple backend tests are currently failing due to test-environment drift, not production defects.
Domain model evolution, updated security configuration, and changes in service signatures have caused several tests to become misaligned with the production code.
This FIXIT issue consolidates all failing tests into a single place and tracks the work required to bring the backend test suite back to a fully green state.
Affected Test Classes
1.
UserControllerTestFailing scenarios:
shouldCreateUser→ returns403instead of201shouldDeleteUserById→ returns403instead of204createUser_missingRequiredFields_returns400→ returns403instead of400getCurrentUser_usesUsernameNotEmail→ returns500due to incomplete stubbingCause:
@WebMvcTestloads Spring Security filters and method-level authorization, but the test configuration disables or replaces the wrong parts.Production code is correct — only the test security environment is inconsistent.
2.
CustomUserDetailsServiceTestFailing scenarios:
shouldLoadUserByEmail→ UsernameNotFound (user not mocked correctly)shouldThrowWhenUserNotFound→ UnnecessaryStubbingExceptionCause:
The User domain object has evolved (additional constructor parameters, validation differences), but the test setup still uses old constructors and mock patterns.
Stubbings no longer match the current behavior of
UserRepository#findByUsername.3. Model / Repository Test Breakages
Example:
ProjectRepositoryTestreferencing outdatedUserconstructorsCause:
Domain model changes (new fields, builder usage, lifecycle annotations) were not applied to older repository tests.
Root Causes (Summary)
@WebMvcTest→ unexpected403responsesUserobjects built with outdated constructorsWhat Needs to Be Done
@WebMvcTest)new User(...)constructors with validated builder-based creationwhen(findByUsername(...))matches actual lookups (username, not email)Why This Matters
Priority & Timeline
Notes
None of the failing tests reflect defects in production code.
This FIXIT issue is a cleanup/refactor task to stabilize the test suite before the next backend-focused cycle.