Phase 3c: Add RegistrationController + RegistrationForm + PasswordMatch to src-spring-boot#31
Open
devin-ai-integration[bot] wants to merge 1 commit intotrunkfrom
Conversation
…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>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Previous PRs (#3, #12) added registration controller migration files but placed them in wrong directories (
src/andapps/example2-spring-boot/src/respectively). The correct location —src-spring-boot/— was never populated. This PR fills that gap by adding:EditRegistrationAction+SaveRegistrationActioninto a single Spring MVC controller withGET /editRegistrationandPOST /saveRegistration@NotBlank,@Email,@PasswordMatch)RegistrationForm.validate()password-match logicregistration.html) for@WebMvcTestview resolutionAll imports use the correct
domain.User/domain.UserDatabasepackage paths matching the existingsrc-spring-bootstructure.Review & Testing Checklist for Human
saveRegistration()against originalSaveRegistrationAction.execute()— the original usesPropertyUtils.copyProperties()(copies all matching bean properties) while the new code explicitly setsfullName,fromAddress,replyToAddress. Verify no properties are missed.@PasswordMatchfires via@Validfor cross-field match, while the controller manually checks password-required-on-Create. Verify these don't produce confusing double errors.registration.htmlwas added tosrc-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.messages.properties: Validation message keys like{error.username.required},{error.password.match}are referenced but nomessages.propertiesexists insrc-spring-boot/main/resources/. Bean Validation will fall back to raw keys. Confirm this is deferred to another phase.mvn test -f apps/faces-example2/pom-spring-boot.xml -Dtest="RegistrationControllerTest,RegistrationFormTest,PasswordMatchValidatorTest"and verify all 33 tests pass.Notes
DatabaseIntegrationTestfailures (ApplicationContext loading) are unrelated to this PR.src/(from PR Add RegistrationController for Spring Boot migration (Phase 3-4) #3) are left untouched — cleanup of those misplaced files is a separate concern.Link to Devin session: https://jack-meigel.devinenterprise.com/sessions/1adf3de01b6b40deb92d2fc1a279c1e3
Requested by: @cogjack