Lambda Deployment, Security Hardening & Test Infrastructure - #4
Merged
Conversation
backend-ci.yml and frontend-ci.yml were the original single-job CI files created before the consolidated multi-job ci-cd.yml pipeline was built. Keeping them caused duplicate runs on every push/PR.
- Add JaCoCo plugin to backend pom.xml for Java code coverage - Add @vitest/coverage-v8 and coverage config to frontend vite.config.ts - Update generate-dashboard.sh with coverage parsers and HTML sections - Add backend/frontend coverage summary cards and detail breakdowns - Add frontend/coverage/ to .gitignore
- Add spring-security-crypto dependency for BCryptPasswordEncoder - Register BCryptPasswordEncoder bean in ToyswapApplication - Hash password on registration (createSwapper) and update (updateSwapper) - Replace findByUsernameAndPassword with findByUsername + BCrypt matches - Remove TODO comment from Swapper model - Update controller and repository tests for BCrypt flow - All 66 backend tests passing
- Add SwapLifecycleIntegrationTest (6 tests): BCrypt login round-trip, duplicate userId 409, create+fetch items by owner, filter by type, full swap lifecycle with ownership transfer, swap inactive item 409 - Add E2E: logout redirects to /login - Add E2E: swap button shows error when user has no items - Backend: 72 tests passing, E2E: 13 tests passing
- SwapController: remove setActive(false) so items stay active with swapped owners - ItemCard: use item.imageUrl with Unsplash fallback instead of always using Unsplash - Update SwapControllerTest to assert active:true after swap - Update SwapLifecycleIntegrationTest: verify swapped items stay active under new owners, remove broken swapWithInactiveItem test - Update frontend mock handlers to return active:true from swap endpoint - Add E2E test: received toy appears on home page after swap, given toy does not
- Parse Surefire XML to separate unit vs integration tests (by package/class name) - Add Integration summary card and detail section to dashboard - Remove unused instruction files (initial-instructions.md, test-instructions.md)
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 Lambda deployment infrastructure, hardens authentication with BCrypt password hashing, fixes swap and image display bugs, and builds comprehensive test infrastructure with a unified dashboard.
Changes
Infrastructure & Deployment
AWS_REGIONfrom Lambda environment variablesbackend-ci.ymlandfrontend-ci.ymlsuperseded byci-cd.ymlSecurity
spring-security-crypto) before persistingfindByUsername+BCryptPasswordEncoder.matches()instead of plaintext comparisonBug Fixes
setActive(false)), so swapped items correctly appear in each user's list under the new ownerItemCardnow uses the item'simageUrlwhen provided, falling back to Unsplash only when absentTest Infrastructure
generate-dashboard.shproducing a single HTML test dashboard with:Tests Added
SwapLifecycleIntegrationTest— BCrypt round-trip, duplicate user 409, create+fetch by owner, filter by type, full swap lifecycleSwapControllerTest, frontend mock handlers, and existing E2E assertions to match new swap behavior (items stay active)Test Results
Mutation score: 83.8% · Backend line coverage: 87.6% · Frontend line coverage: 89.2%