Java migration foundation: Spring Boot/Batch scaffolding, copybook domain layer, mock data fixtures - #198
Open
devanshi-gpta wants to merge 1 commit into
Open
Java migration foundation: Spring Boot/Batch scaffolding, copybook domain layer, mock data fixtures#198devanshi-gpta wants to merge 1 commit into
devanshi-gpta wants to merge 1 commit into
Conversation
…ta fixtures Co-Authored-By: Devanshi Gupta <devanshi.gupta@cognition.ai>
🤖 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
Phase 0/1 of the COBOL→Java migration: a
java-app/Spring Boot + Spring Batch project holding the shared data layer that the per-program migrations (online CICS and batch) will build on. No COBOL program is migrated yet —online/andbatch/are empty packages.The load-bearing piece is
CobolCodec: the sample data encodes signed amounts as zoned decimal with the sign overpunched onto the last digit, so00000001940{is194.00and00000001940}is-194.00. Decoding returns aBigDecimalat the exact copybook scale and encoding is byte-exact, which is asserted by round-tripping every record ofacctdata.txt,carddata.txt,custdata.txtanddailytran.txt:Each copybook becomes one domain class owning its own layout (
RECORD_LENGTH,parse,format), read through aFieldCursorthat walks fields in copybook order:Sample data is not copied into
java-app:pom.xmlmaps../app/data/ASCII/*.txtonto the classpath undercarddemo-data/,FixedWidthFixtureLoader.loadAll()parses it into aCardDemoDataSetbean, and eachInMemory*Repositoryseeds itself from that snapshot. Repositories implementReseedableso tests that mutate balances or users can restore the canonical dataset.RecordKeysnormalizes lookup keys, sofindById("1")andfindById("00000000001")both resolve.USRSEC has no ASCII file, so
MockUserDatareproduces the in-stream users ofapp/jcl/DUSRSECJ.jcl— five admins and five regular users, including the README loginsADMIN001/PASSWORDandUSER0001/PASSWORD.One data quirk worth knowing before the batch work:
acctdata.txtcarries the group id (A000000000) in theACCT-ADDR-ZIPposition and leavesACCT-GROUP-IDblank. Parsing follows the copybook (matching what the COBOL programs see), so interest calculation will resolve against theDEFAULTrows ofdiscgrp.txt.19 tests cover the codec, the loader against all nine sample files, and repository seeding/lookup/mutation.
Link to Devin session: https://app.devin.ai/sessions/a1f9608aacd244c4954b27d7967afe9e
Open in Devin Desktop: https://app.devin.ai/desktop/session/a1f9608aacd244c4954b27d7967afe9e?variant=devin
Requested by: @devanshi-gpta