feat: Java Spring Boot migration - project structure, domain models, services, CLI, and tests#74
Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Conversation
…services, CLI, and tests - Initialize Spring Boot 3.2.x Maven project with JPA, Shell, Jackson, Flyway, Testcontainers - Create domain models: Account (JPA entity), Customer hierarchy (REDEFINES), CustomerRecord, StudentRecord, SerializableRecord - Create utility services: StringUtilService (trim/unstring/isNumeric), SearchService (linear/binary), NumericConversionService - Create database layer: Flyway migration, AccountRepository (JPA), AccountService - Create file processing services: FileMergeService, ReportService, SerializationService - Create Spring Shell CLI: AccountCommands, UtilityCommands, SubProgramCommands - Add unit tests (52 passing): StringUtilServiceTest, SearchServiceTest, SerializationServiceTest, FileMergeServiceTest - Add integration test: AccountRepositoryIT (Testcontainers/PostgreSQL) - Add documentation: java-migration/README.md and migration-matrix.md Co-Authored-By: Jerry Oliphant <jerry.oliphant@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
Complete migration of all COBOL example programs into a single Java Spring Boot application under
java-migration/. The app uses Spring Shell for CLI interaction, Spring Data JPA + Flyway for database access, and Jackson for JSON/XML serialization.What's included (29 files, ~2400 lines):
Account(JPA entity),Customer/PersonCustomer/CorpCustomer(REDEFINES → inheritance),CustomerRecord,StudentRecord,SerializableRecordStringUtilService,SearchService,NumericConversionService,AccountService,FileMergeService,ReportService,SerializationServiceAccountCommands,UtilityCommands,SubProgramCommandsV1__create_accounts.sql) copied from existingsql/create_test_db.sqljava-migration/README.mdandmigration-matrix.mdUnit tests pass locally (
mvn test -Dtest='!*IT'). Integration tests were not run (require Docker for Testcontainers).Review & Testing Checklist for Human
CustomerRecordfixed-width field widths/offsets match the COBOL FD definitions inmerge_sort/merge_sort_test.cbl. Incorrect widths would silently corrupt record parsing infromFixedWidth()/toFixedWidth().V1__create_accounts.sqlis an accurate copy ofsql/create_test_db.sql, and thatAccount.java@Columnname mappings (first_name,last_name,is_enabled,create_dt,mod_dt) match the DDL column names exactly.enabledfield inSerializableRecord/SerializationService.generateXml()— the COBOLTYPE OF ws-record-flag IS ATTRIBUTEshould produceenabled="..."as an XML attribute, not an element.mvn testormvn verify) to confirmAccountRepositoryITpasses against a real PostgreSQL via Testcontainers..gitignoreforjava-migration/— IDE artifacts (.classpath,.project,.settings/) andtarget/are not ignored. They were manually excluded from this commit but will be easy to accidentally commit later.Recommended test plan: Clone the branch, run
cd java-migration && mvn clean verifywith Docker running. Thenmvn spring-boot:runwith a local PostgreSQL (cobol_db_exampledatabase) and exercise the shell commands listed in the README.Notes
application.ymluses env-var placeholders (${DB_URL:...},${DB_USERNAME:...},${DB_PASSWORD:}) with sensible defaults for local dev.SubProgramCommandssimulates COBOL working-storage persistence via mutable instance fields and CANCEL via field reset — a reasonable approximation but not a perfect semantic match.mouse/mouse_example.cblintentionally not migrated (terminal curses demo, no business value).Link to Devin session: https://app.devin.ai/sessions/518f2d09e8374455a2578de070f5f06e
Requested by: @jerryoliphant-cog