-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Replace usages of RxJava2 in testing with Reactor Test #47489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Replace usages of RxJava2 in testing with Reactor Test #47489
Conversation
There was a problem hiding this 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
TestSubscriberwith ReactorStepVerifierfor most test validations - Migrated to Reactor
TestSubscriberfor 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 |
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:
General Guidelines and Best Practices
Testing Guidelines