Phase 5: Integration, E2E, and Regression Tests for Spring Boot Migration#23
Open
devin-ai-integration[bot] wants to merge 2 commits intotrunkfrom
Open
Phase 5: Integration, E2E, and Regression Tests for Spring Boot Migration#23devin-ai-integration[bot] wants to merge 2 commits intotrunkfrom
devin-ai-integration[bot] wants to merge 2 commits intotrunkfrom
Conversation
…igration - Add RegistrationController, SubscriptionController to src-spring-boot - Add RegistrationForm, SubscriptionForm, PasswordMatch validation - Add WebMvcConfiguration for /welcome, /mainMenu, / view routes - Copy templates, messages.properties, static resources to src-spring-boot - Add ApplicationContextIntegrationTest (verifies all controllers loaded) - Add LogonIntegrationTest (full request login/logout flow) - Add RegistrationIntegrationTest (user creation and editing) - Add SubscriptionIntegrationTest (CRUD operations with auth) - Add EndToEndUserJourneyTest (complete user journeys) - Add RegressionTest (login, registration, subscription, logout checklist) - Fix mainMenu.html null-safe session access - All 170 tests pass, application smoke test verified 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:
|
Owner
|
@devin wake |
Author
|
❌ Cannot revive Devin session - the session is too old. Please start a new session instead. |
Add 64 new unit tests (234 total) covering: - RegistrationFormTest: Bean Validation constraints for all fields - SubscriptionFormTest: Bean Validation constraints including @pattern for type - PasswordMatchValidatorTest: Cross-field password validation edge cases - RegistrationControllerTest: @WebMvcTest for create/edit/validation flows - SubscriptionControllerTest: CRUD operations, cancel, delete, validation Co-Authored-By: Jack Meigel <jack.meigel@cognition.ai>
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.
Phase 5: Integration, E2E, and Regression Tests for Spring Boot Migration
Summary
Completes Phase 5 of the Struts-to-Spring-Boot migration for
faces-example2. This PR adds 139 new tests (234 total, up from 95) covering unit, integration, end-to-end user journeys, and regression scenarios.Important: This PR also introduces production code that was missing from
src-spring-boot/— specificallyRegistrationController,SubscriptionController, their form beans, validation annotations, aWebMvcConfigurer, and all Thymeleaf templates/resources. These were manually rewritten from the legacysrc/versions with corrected imports for thedomain.*package structure.Production code added
RegistrationController— handles user registration create/edit flowsSubscriptionController— handles subscription CRUD with session-based authRegistrationForm/SubscriptionForm— form backing beans with Bean ValidationPasswordMatch/PasswordMatchValidator— custom class-level password matchingWebMvcConfiguration— view controllers for/welcome,/mainMenu,/messages.properties, static resources copied tosrc-spring-boot/mainMenu.html— null-safe session access (${session?.user?.username})Test suites added
@Patternfor type field (imap/pop3 only)@WebMvcTestunit tests for create/edit flows, validation errors, duplicate username, session handling@SpringBootTest+@AutoConfigureMockMvctests for CRUD operations, cancel, delete, validation errors, auth checksAll 234 tests pass.
Updates since last revision
Added 64 unit tests across 5 new test files to close gaps identified in the Migration Plan Section 5.2 (Unit Testing Requirements):
RegistrationFormTest(16 tests) — Bean Validation for all fieldsSubscriptionFormTest(14 tests) — Bean Validation including@Patternregex for typePasswordMatchValidatorTest(7 tests) — custom validator edge casesRegistrationControllerTest(13 tests) —@WebMvcTestwith mockedUserDatabaseSubscriptionControllerTest(14 tests) — uses@SpringBootTestinstead of@WebMvcTestbecauseSubscriptionControllerdepends onList<LabelValueBean>which can't be wired in a@WebMvcTestsliceReview & Testing Checklist for Human
src/behavior — This controller was manually rewritten, not copied. Key areas: password preservation on Edit action (lines 154-162), duplicate username check ordering, error handling. Compare againstsrc/main/java/.../RegistrationController.java.src/behavior — Manually rewritten. Key areas: cancel flow (lines 141-147), delete flow (lines 207-229), session attribute management forSUBSCRIPTION_KEY. Compare againstsrc/main/java/.../SubscriptionController.java.@SpringBootTestcontext with in-memory database. Tests useSystem.currentTimeMillis()for unique names, but subscription tests mutate the pre-loaded "user" account. Run tests multiple times to verify no flakiness.${session.user.username}to${session?.user?.username}. Confirm this renders correctly when user IS present (not just when absent).Test Plan
Notes
src/for legacy,src-spring-boot/for Spring Boot) required copying and adapting files. Import paths were changed fromorg.apache.struts.webapp.example2.Usertoorg.apache.struts.webapp.example2.domain.User.PasswordMatchvalidation is applied at class level onRegistrationForm, but the controller also manually checks for blank passwords on Create action. This is intentional for better error messages.SubscriptionControllerTestuses@SpringBootTestinstead of@WebMvcTestbecause the controller requires aList<LabelValueBean>bean that Spring's@WebMvcTestslice cannot wire. This means these tests load the full application context including the real in-memory database rather than mocks.Link to Devin session: https://jack-meigel.devinenterprise.com/sessions/c08e41f37ed342fa9c630d3f63575ec8
Requested by: @cogjack