Skip to content

Conversation

@alzimmermsft
Copy link
Member

Description

Replace usage of RxJava2 in Cosmos tests with equivalent logic using Reactor Test given the SDK uses Reactor and not RxJava.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@alzimmermsft alzimmermsft self-assigned this Dec 8, 2025
@github-actions github-actions bot added the Cosmos label Dec 8, 2025
@alzimmermsft alzimmermsft marked this pull request as ready for review December 9, 2025 14:39
Copilot AI review requested due to automatic review settings December 9, 2025 14:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates Cosmos SDK tests from RxJava2 to Reactor Test, aligning the testing framework with the SDK's actual reactive implementation (Reactor). The migration replaces io.reactivex.subscribers.TestSubscriber with reactor.test.StepVerifier and reactor.test.subscriber.TestSubscriber, removes RxJava2 dependencies, and updates related comments.

Key Changes:

  • Replaced RxJava2 TestSubscriber with Reactor StepVerifier for most test validations
  • Migrated to Reactor TestSubscriber for backpressure testing scenarios
  • Updated comments referencing RxJava to reference Reactor
  • Removed RxJava2 dependency from test scope in pom.xml files
  • Applied code quality improvements (static final modifiers, long literal style, redundant cast removal)

Reviewed changes

Copilot reviewed 38 out of 38 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
StoreReader.java Updated comments from RxJava references to Reactor, removed redundant casts, improved string joining logic
ConsistencyWriter.java Updated comments from RxJava to Reactor references
DatabaseForTest.java Made logger and TIME_FORMATTER static final, reordered imports
TopQueryTests.java Migrated TestSubscriber to StepVerifier for query continuation token testing
TestSuiteBase.java Replaced RxJava2 TestSubscriber validation patterns with StepVerifier patterns
SinglePartitionDocumentQueryTest.java Migrated continuation token test to StepVerifier with AtomicReference pattern
ReadFeedExceptionHandlingTest.java Simplified error verification using StepVerifier.expectNextCount().verifyError()
QueryValidationTests.java Migrated query result collection to StepVerifier with collectList()
ParallelDocumentQueryTest.java Replaced TestSubscriber with StepVerifier for continuation token queries
OrderbyDocumentQueryTest.java Migrated multiple query tests to StepVerifier, changed from long literals with 'l' to 'L'
OffsetLimitQueryTests.java Migrated continuation token tests to StepVerifier
FeedRangeQueryTests.java Migrated query result collection to StepVerifier
BackPressureTest.java Migrated to Reactor TestSubscriber for backpressure testing with proper API usage
BackPressureCrossPartitionTest.java Migrated backpressure tests to Reactor TestSubscriber
FetcherTest.java Simplified validation using StepVerifier.consumeNextWith()
DocumentProducerTest.java Migrated producer tests to StepVerifier, identified missing assertion
StoreReaderTest.java Replaced RxJava2 validation helpers with StepVerifier-based validation
StoreReaderDotNetTest.java Migrated validation methods to StepVerifier
RntbdTransportClientTest.java Simplified failure validation using StepVerifier
ReplicatedResourceClientTest.java Migrated with proper Exceptions.unwrap() for error validation
ReplicatedResourceClientRetryWithTest.java Replaced TestSubscriber validation with StepVerifier
ReplicatedResourceClientPartitionSplitTest.java Migrated validation methods, missing Exceptions.unwrap()
QuorumReaderTest.java Changed long literals from lowercase 'l' to uppercase 'L', migrated validations
MetadataRequestRetryPolicyTests.java Migrated ShouldRetryResult validation to StepVerifier
HttpTransportClientTest.java Simplified validation methods using StepVerifier
GatewayAddressCacheTest.java Migrated address cache validation to StepVerifier
ConsistencyWriterTest.java Migrated timeout tests to StepVerifier, added Reactor TestSubscriber import
ConsistencyReaderTest.java Migrated validation methods to StepVerifier, reordered imports
WebExceptionRetryPolicyTest.java Migrated retry policy validation to StepVerifier
TestSuiteBase (impl).java Migrated base test validation methods to StepVerifier
RxGatewayStoreModelTest.java Simplified failure validation using StepVerifier
RetryUtilsTest.java Migrated with proper Exceptions.unwrap() for error handling
ClientRetryPolicyTest.java Migrated retry result validation to StepVerifier
RetryContextOnDiagnosticTest.java Migrated response validation methods to StepVerifier
CosmosMultiHashTest.java Migrated continuation token tests to StepVerifier
azure-cosmos-tests/pom.xml Removed RxJava2 dependency
azure-cosmos-encryption/pom.xml Removed RxJava2 dependency
external_dependencies.txt Removed RxJava2 from external dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant