Repository navigation
COG-1145: W0 smoke suite — admin REST + Boot 1.5 golden JSON fixtures - #346
Conversation
…arse-equivalence comparator Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
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
Linear: COG-1145
Stacked on #335 (COG-1141 Testcontainers harness) — base is
devin/cog-1141-w0-testcontainers-mysql-harness-for-springboottest-boot-154; retarget tomasterwhen #335 merges. Test-only; no production code, Boot or Java changes.Captures today's (Boot 1.5.4 / Jackson 2.8) admin REST contract as golden JSON, plus a public parse-equivalence comparator that later waves assert against.
com.userFront.golden.JsonParseEquivalence(public API for later waves)1000.00 == 1000)...+0000==...+00:00==...Z; offset-less/unparseable strings fail$.path: ...in one assertionGoldenFixtures:assertMatches(BOOT15, name, actualNode, equivalence)readsclasspath:/golden/boot15/<name>.json;-Dgolden.update=truerewrites the files undersrc/test/resources/golden/boot15/instead.AdminRestSmokeTest extends AbstractIntegrationTest(asROLE_ADMINvia MockMvc):GET /api/user/alluser-all.jsonGET /api/user/primary/transaction?username=user-primary-transaction.jsonGET /api/user/savings/transaction?username=user-savings-transaction.jsonGET /api/appointment/allappointment-all.jsonGET /api/user/{u}/disable,/enableenabledflips in DBROLE_USERNotes for reviewers / later waves:
adminsmoke-*rows this class seeds (other smoke classes share the JVM/context/DB), transaction and appointment rows sorted bydate(their queries have no ORDER BY, so wire order is not part of the contract), pretty-printed with exact decimals. Generatedid/userIdare presence+type only; account numbers, balances, dates and the (fake) exposed password hash are seeded with fixed values, so fixtures are deterministic regardless of test order.91145001..6, not signup, to avoid the static account-number counter bug (COG-1179). Uniqueadminsmoke-usernames, so no clash withsmokeuserin COG-1144: W0 smoke suite for appointment create/list/confirm #108/COG-1142: W0 smoke suite — signup, login, logout, remember-me (MockMvc) #109.recipientList:RECIPIENT_LIST_IN_USER_ALL = truerecords thatUser.recipientListis serialised today. It also appears in the nesteduserof/api/appointment/all. COG-1150 (COG-1150: W1 · User + UserRole GenerationType.IDENTITY and @JsonIgnore on recipientList #341) must flip the constant and regenerate bothuser-all.jsonandappointment-all.json(-Dgolden.update=true) with a note in its PR body.toggleUser(username, action)helper builds the request (currentlyget(...)); COG-1154 only needs to change that line./api/user/allis fully serialised and parsed, so W5'sopen-in-view=falsewill surface aLazyInitializationExceptiononrecipientListhere.Verification (Temurin 8u504 + Docker, mysql:5.7.44 Testcontainer)
mvn -B -f UserFront/pom.xml verify:Comparator drift checks against the real endpoint (fixture edited temporarily, then restored):
"2017-06-15T10:15:30.000+00:00"/"2017-06-16T09:00:00Z"→ passes (epoch ms served vs ISO in fixture)+0000) and one balance changed →Same-JVM coexistence with the sibling smoke classes (copied temporarily from the COG-1142/1143/1144 branches into a scratch worktree):
AdminRestSmokeTest7/7 green alongsideMoneyMovementSmokeTest,AppointmentSmokeTest,AuthSmokeTest.AuthSmokeTestfails 5/5 when run afterMoneyMovementSmokeTestwith or without this class present (signup hits COG-1179);AdminRestSmokeTest,AuthSmokeTesttogether are both green — so that interaction is pre-existing and not caused here.Link to Devin session: https://app.devin.ai/sessions/030cd558f2f149b383bc2f6f651361e5
Open in Devin Desktop: https://app.devin.ai/desktop/session/030cd558f2f149b383bc2f6f651361e5?variant=devin
Requested by: @patrickbradley-cog
Devin Review