Skip to content

fix(testkit): create a fresh Stripe customer per test run#29

Merged
fupelaqu merged 1 commit into
mainfrom
feature/audit
Jun 17, 2026
Merged

fix(testkit): create a fresh Stripe customer per test run#29
fupelaqu merged 1 commit into
mainfrom
feature/audit

Conversation

@fupelaqu

Copy link
Copy Markdown
Contributor

The Stripe provider's createOrUpdateCustomer reuses an existing customer matched by email (Customer.list(email).headOption). With the fixed test email demo@softnetwork.fr, every run reattached pm_card_visa to the SAME persisted customer until Stripe rejected with customer_max_payment_methods, failing StripeLicenseIntegrationSpec.registerCard (and any card flow) — the in-memory journal means the account is recreated each run, so the email lookup is the actual reuse vector.

Make email unique per JVM run (demo+@softnetwork.fr), evaluated once as a val so it stays a single source of truth within a run (every user/assertion referencing email still sees the same value) while differing across runs → Customer.list misses → a brand-new customer each run.

This ships in the published payment-testkit artifact, so republish payment-testkit for downstream consumers (e.g. softclient4es-license-server) to pick it up.

The Stripe provider's createOrUpdateCustomer reuses an existing customer
matched by email (Customer.list(email).headOption). With the fixed test
email demo@softnetwork.fr, every run reattached pm_card_visa to the SAME
persisted customer until Stripe rejected with customer_max_payment_methods,
failing StripeLicenseIntegrationSpec.registerCard (and any card flow) — the
in-memory journal means the account is recreated each run, so the email
lookup is the actual reuse vector.

Make `email` unique per JVM run (demo+<uuid8>@softnetwork.fr), evaluated
once as a val so it stays a single source of truth within a run (every
user/assertion referencing `email` still sees the same value) while
differing across runs → Customer.list misses → a brand-new customer each run.

This ships in the published payment-testkit artifact, so republish
payment-testkit for downstream consumers (e.g. softclient4es-license-server)
to pick it up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.94%. Comparing base (4bba2b0) to head (10c2b87).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main      #29    +/-   ##
========================================
  Coverage   40.94%   40.94%            
========================================
  Files         155      155            
  Lines       10859    10859            
  Branches     1604     1810   +206     
========================================
  Hits         4446     4446            
  Misses       6413     6413            
Flag Coverage Δ
unittests 40.94% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fupelaqu fupelaqu merged commit 338d1ea into main Jun 17, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant