[Cosmos] Extract a StoreResult test factory to replace the 20-arg positional constructor in unit tests
メンテナーはふだん 1 日以内に返信
@mbhaskar がすでに取り組んでいます。
2026年6月9日 から。
評価
この issue はまだ評価されていません。
説明
Summary
Follow-up from PR #48914 (review feedback from @kushagraThapar).
The 20-arg positional new StoreResult(...) constructor is repeated across many test methods (in ConsistencyWriterTest.java at lines ~667, 725, 757, 779, 834, 894, 903, 919, 947, and several more in QuorumReaderTest.java). Each invocation follows the same pattern: most arguments are constants/null/false, with only 2–3 meaningful per test (replica role, isThrottledException, isValid).
This positional-constructor accretion has been growing across multiple PRs and makes tests verbose and fragile.
Proposed change
Extract a StoreResultTestFactory (or builder) with named, intent-revealing methods, e.g.:
throttled429()valid(int globalCommittedLsn)unhealthy(replicaRole)
Benefits:
- New tests become 1-line setup instead of ~20-line setup.
- When the
StoreResultconstructor changes (e.g. adding a 21st arg), only the factory updates instead of N test sites. - Test intent becomes self-documenting (
throttled429()reads as a behavior, not a 20-arg ctor invocation).
Scope
Test-only refactor; no production behavior change. Update existing StoreResult-based tests in:
sdk/cosmos/azure-cosmos-tests/.../directconnectivity/ConsistencyWriterTest.javasdk/cosmos/azure-cosmos-tests/.../directconnectivity/QuorumReaderTest.java
Context
Reviewer noted this is "not a blocker for [PR #48914] but worth scheduling as a follow-up before the next test wave lands on top."
- 主要言語
- Java
- スター
- 2.6k
- フォーク
- 2.2k
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 220
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Azure/azure-sdk-for-java のほかの issue
-
mgmt, in track 1 migration guide, call out that file-based authentication method is not recommended再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンAzure.Identity
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
Azure/azure-sdk-for-java#48894 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
Azure/azure-sdk-for-java#50905 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] - Handler.close livelocks on FAIL_NON_SERIALIZED while holding the ReactorConnection monitor対応中かも @conniey が 1 日前に担当しました。 オープンAzure.Core.AMQP Client customer-reported needs-team-attention question
Azure/azure-sdk-for-java#50879 · コメント 2 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Design] Support External Evaluation Policy (Invoke) in management SDKs対応中かも @weidongxu-microsoft が 6 日前に担当しました。 オープン
Azure/azure-sdk-for-java#50818 · リアクション 2 件 · 担当者 2 名 ·
メンテナーはふだん 1 日以内に返信
-
[FEATURE REQ] ChangeFeedProcessor event handler fully reactive implementation対応中かも @FabianMeiswinkel が 7 日前に担当しました。 オープンClient Cosmos customer-reported feature-request needs-team-attention Service Attention
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
Azure/azure-sdk-for-java#50758 · コメント 3 件 · リアクション 1 件 · 担当者 2 名 ·
メンテナーはふだん 1 日以内に返信
Azure/azure-sdk-for-java の issue をすべて見る
似ている issue
-
approved
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
checkstyle/checkstyle#22129 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
objectionary/lints#1577 ·
メンテナーはふだん 2 日以内に返信
-
ChaosEngine: backup-remote doctor row passes while consumer mode hides bot memory from git対応中かも @MohabMohie が今日担当しました。 オープンagentic
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ShaftHQ/SHAFT_ENGINE#7263 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100