Skip to content

Phase 3c: Add RegistrationController + RegistrationForm + PasswordMatch to src-spring-boot#31

Open
devin-ai-integration[bot] wants to merge 1 commit intotrunkfrom
devin/1775135589-registration-controller-migration
Open

Phase 3c: Add RegistrationController + RegistrationForm + PasswordMatch to src-spring-boot#31
devin-ai-integration[bot] wants to merge 1 commit intotrunkfrom
devin/1775135589-registration-controller-migration

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot commented Apr 2, 2026

Summary

Previous PRs (#3, #12) added registration controller migration files but placed them in wrong directories (src/ and apps/example2-spring-boot/src/ respectively). The correct location — src-spring-boot/ — was never populated. This PR fills that gap by adding:

  • RegistrationController — combines EditRegistrationAction + SaveRegistrationAction into a single Spring MVC controller with GET /editRegistration and POST /saveRegistration
  • RegistrationForm — POJO with Bean Validation (@NotBlank, @Email, @PasswordMatch)
  • @PasswordMatch + PasswordMatchValidator — custom cross-field constraint replacing RegistrationForm.validate() password-match logic
  • 33 unit tests — 17 controller (MockMvc), 10 form validation, 6 password-match validator
  • Minimal test template (registration.html) for @WebMvcTest view resolution

All imports use the correct domain.User / domain.UserDatabase package paths matching the existing src-spring-boot structure.

Review & Testing Checklist for Human

  • Business logic parity: Compare saveRegistration() against original SaveRegistrationAction.execute() — the original uses PropertyUtils.copyProperties() (copies all matching bean properties) while the new code explicitly sets fullName, fromAddress, replyToAddress. Verify no properties are missed.
  • Password validation overlap: @PasswordMatch fires via @Valid for cross-field match, while the controller manually checks password-required-on-Create. Verify these don't produce confusing double errors.
  • Missing production template: No registration.html was added to src-spring-boot/main/resources/templates/ (only a test stub exists). Confirm this is acceptable if templates are handled separately in Phase 4, or flag if it should be included here.
  • Missing messages.properties: Validation message keys like {error.username.required}, {error.password.match} are referenced but no messages.properties exists in src-spring-boot/main/resources/. Bean Validation will fall back to raw keys. Confirm this is deferred to another phase.
  • Manual test plan: Build with mvn test -f apps/faces-example2/pom-spring-boot.xml -Dtest="RegistrationControllerTest,RegistrationFormTest,PasswordMatchValidatorTest" and verify all 33 tests pass.

Notes

Link to Devin session: https://jack-meigel.devinenterprise.com/sessions/1adf3de01b6b40deb92d2fc1a279c1e3
Requested by: @cogjack


Open with Devin

…atch validation to src-spring-boot

- Add RegistrationController with GET /editRegistration and POST /saveRegistration
  - Handles Create (new user) and Edit (existing user) modes
  - Bean Validation + programmatic checks (password required on Create, username uniqueness)
  - Uses domain.User and domain.UserDatabase (correct src-spring-boot package structure)
- Add RegistrationForm POJO with Bean Validation (@notblank, @Email, @PasswordMatch)
- Add @PasswordMatch custom annotation and PasswordMatchValidator for cross-field password validation
- Add RegistrationControllerTest (17 tests): create/edit modes, validation errors, session management
- Add RegistrationFormTest (10 tests): field validation, getters/setters, defaults
- Add PasswordMatchValidatorTest (6 tests): matching, mismatched, null, empty passwords
- Add registration.html test template for WebMvcTest view resolution
- All 42 controller/form/validation tests pass

Co-Authored-By: Jack  Meigel <jack.meigel@cognition.ai>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

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