Add test suite and CI pipeline#175
Open
devin-ai-integration[bot] wants to merge 2 commits intoDevOpsfrom
Open
Conversation
- Add H2 in-memory database for test configuration - Add AccountService unit tests (13 tests) with Mockito - Add BankController integration tests (8 tests) with MockMvc - Add GitHub Actions CI workflow for DevOps and main branches - All 22 tests pass (including existing contextLoads) Co-Authored-By: Arjun Mishra <arjunsaxmishra@gmail.com>
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:
|
Devin Review
|
Co-Authored-By: Arjun Mishra <arjunsaxmishra@gmail.com>
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 a comprehensive test suite and GitHub Actions CI pipeline to the project. No existing source code was modified.
Changes:
h2test dependency topom.xmland createdsrc/test/resources/application.propertieswith H2 in-memory configuration so tests run without MySQLregisterAccount,deposit,withdraw,transferAmount,getTransactionHistory,loadUserByUsername, andfindAccountByUsername— including error paths (duplicate username, insufficient funds, recipient not found, user not found). Uses Mockito mocks.@SpringBootTest+MockMvcto test/registerGET/POST,/dashboardauth requirement,/depositPOST,/withdrawPOST (success + insufficient funds), and/transactionsGET. Uses@WithMockUserfor authenticated endpoints..github/workflows/ci.yml): Runs./mvnw clean verifyon pushes/PRs toDevOpsandmainbranches with JDK 17 + Maven caching. Uploads surefire reports as artifacts.All 22 tests pass (1 existing
contextLoads+ 13 service + 8 controller).Review & Testing Checklist for Human
pom.xmlH2 dep, and CI workflow added)Notes
BankappApplicationTests.contextLoads()test continues to pass with the H2 test configuration@MockBeanfromorg.springframework.boot.test.mock.mockitoused for Spring Boot 3.3.3 compatibilityLink to Devin session: https://app.devin.ai/sessions/ce6286e4680d4df0bb9194885e602a05
Requested by: @Colhodm