Skip to content

Fix fault injection and assertion issues in customer workflow tests (PR #49568 review)#49569

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-code-issues-from-review-thread
Draft

Fix fault injection and assertion issues in customer workflow tests (PR #49568 review)#49569
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-code-issues-from-review-thread

Conversation

Copilot AI commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Addresses 7 unresolved review comments from PR #49568 across three test files in the new customer workflow test suite.

CustomerWorkflowTestBase

  • configureResponseDelayRule: Was hard-coding FaultInjectionConnectionType.DIRECT, so response-delay fault rules never matched gateway requests. Changed to currentFaultInjectionConnectionType() (mirrors the existing fix already applied to configureServerErrorRule).

  • assertKeywordIdentifier: getKeywordIdentifiers() returns Set<String> (unordered), but the assertion used containsExactly() which is order-sensitive and flaky. Changed to containsExactlyInAnyOrder() — order-insensitive while still enforcing no unexpected additional elements.

CustomerWorkflowChangeFeedProcessorTest

  • Removed unused import java.util.HashSet.

CustomerWorkflowRequestOptionsTest

  • Replaced magic HTTP status literals (201, 200, 204) with HttpConstants.StatusCodes.CREATED, HttpConstants.StatusCodes.OK, and HttpConstants.StatusCodes.NO_CONTENT for consistency with the rest of the Cosmos test suite. Added the corresponding import.
// Before
assertThat(createResponse.getStatusCode()).isEqualTo(201);
assertThat(readResponse.getStatusCode()).isEqualTo(200);
assertThat(upsertResponse.getStatusCode()).isEqualTo(200);
assertThat(deleteResponse.getStatusCode()).isEqualTo(204);

// After
assertThat(createResponse.getStatusCode()).isEqualTo(HttpConstants.StatusCodes.CREATED);
assertThat(readResponse.getStatusCode()).isEqualTo(HttpConstants.StatusCodes.OK);
assertThat(upsertResponse.getStatusCode()).isEqualTo(HttpConstants.StatusCodes.OK);
assertThat(deleteResponse.getStatusCode()).isEqualTo(HttpConstants.StatusCodes.NO_CONTENT);

- Fix configureResponseDelayRule to use currentFaultInjectionConnectionType()
  instead of hard-coded DIRECT in CustomerWorkflowTestBase
- Fix assertKeywordIdentifier to use containsExactlyInAnyOrder for Set<String>
- Remove unused HashSet import from CustomerWorkflowChangeFeedProcessorTest
- Replace magic HTTP status numbers with HttpConstants.StatusCodes.* in
  CustomerWorkflowRequestOptionsTest

Co-authored-by: FabianMeiswinkel <19165014+FabianMeiswinkel@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix code based on review comments Fix fault injection and assertion issues in customer workflow tests (PR #49568 review) Jun 19, 2026
Copilot AI requested a review from FabianMeiswinkel June 19, 2026 09:17
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.

2 participants