Phase 3d: Add comprehensive SubscriptionController test coverage#32
Open
devin-ai-integration[bot] wants to merge 1 commit intotrunkfrom
Open
Conversation
Add 15 new tests (19→34 total) covering behavioral gaps: - Default action behavior (no action param defaults to Create) - Form field population verification on Edit and Delete actions - Delete action with non-existing subscription redirects correctly - Session attribute management (subscription stored on edit, removed on save/cancel/delete) - AutoConnect handling (set true, default false, update on edit) - Multiple simultaneous validation errors - User model attribute present on validation error and duplicate host paths 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
Adds 15 new tests to
SubscriptionControllerTest(19 → 34 total, 103 tests overall) to close behavioral coverage gaps identified by comparing the migrated Spring controller against the original StrutsEditSubscriptionAction/SaveSubscriptionAction.No production code changes — test-only PR.
New test categories:
actionparam defaults to"Create"Subscription→SubscriptionFormon Edit and DeleteSUBSCRIPTION_KEYis stored on edit and removed after save, cancel, and delete across all action types (5 tests)true, implicit defaultfalse, and update-on-edit pathsuseris in the model when returning the form with validation errors or duplicate-host errors (needed for template rendering)Review & Testing Checklist for Human
SUBSCRIPTION_KEYremoved from the session on every save/cancel/delete path? Cross-reference with originalSaveSubscriptionActionbehavior.autoConnectdefault-to-false test (saveSubscription_CreateAction_WithoutAutoConnect_ShouldDefaultToFalse) reflects correct Struts-era semantics — original usedPropertyUtils.copyPropertieswhich may have behaved differently for unchecked checkboxes.ShouldPopulateAllFormFields,ShouldPopulateFormFieldsFromSubscription) aren't redundant with the existingShouldPopulateForm/ShouldShowFormtests — the new ones add field-level assertions the originals lacked.Suggested test plan:
cd apps/faces-example2 && mvn test— all 103 tests should pass.Notes
@NotBlankpassword validation and baseline controller tests.assertThat) for the new field-level and session assertions, consistent with Spring Boot test conventions. The existing tests used only MockMvc matchers.Link to Devin session: https://jack-meigel.devinenterprise.com/sessions/8d11037d5a16405f975921abf07218fc
Requested by: @cogjack