Repository navigation
Conversation
…profile LocalSampleDataSeedRunner (local profile only, idempotent, UUID v5 ids from fixed sample hrefs): - RetailCustomer customer/customer (ROLE_USER) owning one electricity UsagePoint with LocalTimeParameters (US Eastern), an hourly kWh ReadingType, a MeterReading with 2 daily IntervalBlocks of 24 hourly readings with cost, a UsageSummary and an ElectricPowerQualitySummary. - Customer, CustomerAccount, CustomerAgreement, ServiceLocation and Meter for one residential customer. - ApplicationInformation for the AS-seeded third_party client with the TP's local URIs. Schema values follow the most common shapes in the Green Button CMD certification test feeds; every identifying value is synthetic (example.com, 555-01xx, SAMPLE- numbers). The data exposed a real defect: with open-in-view off, the IntervalBlock, UsageSummary and CustomerAccount controllers mapped entities outside any session, so a lazy collection (intervalReadings, costAdditionalDetailLastPeriod, notifications) made every non-empty feed 500. Those controllers now run read-only transactional. LocalSampleDataSeedRunnerTest runs the seed against the Flyway-migrated H2 schema and checks that each feed marshals its entries, the customer login and readings, and idempotency. Runbook and both smoke scripts updated (new check: the IntervalBlock feed contains the sample data). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… database) Every Spring test context in the DC module shares the in-memory testdb, so other tests can add UsagePoint or ApplicationInformation rows before this one runs (CI order). Check that each feed contains the seeded entries' stable ids instead of an exact entry total. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Closes #253.
What
On the
localprofile the Data Custodian now starts with a small, deterministic ESPI dataset, so the consent flow and every ESPI feed can be tested by hand right afterscripts/local/start-all.sh.LocalSampleDataSeedRunner:@Profile("local")only.It seeds:
customer/customer(ROLE_USER), owning one electricity UsagePoint. The UsagePoint has:third_partyclient, with the TP's local redirect and notification URIs.Where the values come from
The ESPI schema values are the most common shapes across the Green Button CMD certification test feeds:
accumulationBehaviour 4,commodity 1,kind 12,uom 72,powerOfTenMultiplier -3, currency 840;360E2000/B40E2000;Every identifying value is synthetic (
example.com,555-01xx,SAMPLE-…numbers). Nothing is copied from a certification record.The issue suggested a Flyway seed instead. This PR uses a runner, which does not depend on the
localprofile adopting Flyway (#241), and keeps the customer password bcrypt-encoded at runtime likeDevSandboxAdminSeedRunner.Defect found by the data
open-in-viewis off. The IntervalBlock, UsageSummary and CustomerAccount controllers mapped entities to DTOs outside any session, so any non-empty feed returned 500 with aLazyInitializationExceptiononintervalReadings,costAdditionalDetailLastPeriodornotifications. These three controllers are now@Transactional(readOnly = true). The other seeded feeds were not affected.Tests
LocalSampleDataSeedRunnerTest(local+testprofiles) runs on the Flyway-migrated, Hibernate-validated H2 schema, not a generated one. It checks:This is the real-data guard that DC feed (collection) endpoints return 500: a bare List is passed to JAXB instead of an Atom feed #247 asked for.
The full DC suite passes locally: 184 tests.
On the running stack, all nine seeded feeds return 200 with entries.
smoke.shandsmoke.ps1pass 26/26, including a new check that the IntervalBlock feed carries the sample data. Once fix(authserver,datacustodian): FB=34_35 client access token, CMD v2.14 customer scopes, FB_51 requires customerResourceURI #260 merges, the count becomes 28.docs/LOCAL_TESTING.mdgains a "Sample data" section and thecustomerlogin. The #253 blocker is removed.🤖 Generated with Claude Code