Scala integration tests refactoring#1195
Merged
Conversation
… add test for multiple recreations
… headers in SqsClient
… client to AWS SDK v2
…test structure, updating to AWS SDK v2 clients
…zonJavaSdkNewTestSuite
…, simplifying configuration and reusing shared logic
…e and utilize SQSRestServerWithSdkV2Client, reorganizing server/client lifecycle logic
…egrationTestsBase` and reorganize packages for consistency and better structure
There was a problem hiding this comment.
Pull request overview
This PR refactors the Scala integration tests for ElasticMQ, reorganizing the test structure to improve maintainability and enable better multi-SDK testing. The changes primarily involve moving tests from a monolithic structure to a trait-based, modular organization.
Changes:
- Restructured integration tests into trait-based modules by functionality (QueueOperationsTests, MessageOperationsTests, FifoQueueTests, etc.)
- Reorganized client code from
org.elasticmq.rest.sqs.clienttoorg.elasticmq.rest.sqs.integration.client - Added UUID-based postfix to queue actor names in QueueManagerActor to prevent name collision issues when recreating queues
- Created common test infrastructure (IntegrationTestsBase, SQSRestServerWithSdkV1Client, SQSRestServerWithSdkV2Client)
- Deleted old monolithic test files and replaced with modular test traits
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| core/src/main/scala/org/elasticmq/actor/QueueManagerActor.scala | Adds UUID postfix to actor names to fix queue recreation race condition |
| rest/rest-sqs-testing-amazon-java-sdk/src/test/scala/org/elasticmq/rest/sqs/integration/multisdk/*.scala | New trait-based test modules organized by functionality |
| rest/rest-sqs-testing-amazon-java-sdk/src/test/scala/org/elasticmq/rest/sqs/integration/common/*.scala | Common test infrastructure and base classes |
| rest/rest-sqs-testing-amazon-java-sdk/src/test/scala/org/elasticmq/rest/sqs/integration/client/*.scala | Reorganized client abstraction layer |
| rest/rest-sqs/src/test/scala/org/elasticmq/rest/stats/StatisticsDirectivesTest.scala | Added test for queue recreation scenario |
| rest/rest-sqs-testing-amazon-java-sdk/src/test/scala/org/elasticmq/rest/sqs/*.scala (deleted) | Removed old monolithic test files |
Comments suppressed due to low confidence (3)
rest/rest-sqs-testing-amazon-java-sdk/src/test/scala/org/elasticmq/rest/sqs/integration/client/AwsSdkV2SqsClient.scala:505
- Debug logging statements should be removed or replaced with proper logging framework usage. These println statements for debugging are not appropriate for production code and may clutter output during test execution.
rest/rest-sqs-testing-amazon-java-sdk/src/test/scala/org/elasticmq/rest/sqs/integration/common/IntegrationTestsBase.scala:72 - The method filterKeys is deprecated in Scala 2.13. Consider using filter with a tuple pattern instead: messageAttributes.filter { case (k, _) => requestedAttributes.contains(k) }
messageAttributes.filterKeys(k => requestedAttributes.contains(k)).toMap
rest/rest-sqs-testing-amazon-java-sdk/src/test/scala/org/elasticmq/rest/sqs/integration/multisdk/MessageOperationsTests.scala:27
- This test has confusing and outdated comments that suggest uncertainty about test behavior. The comments indicate the test was modified based on previous failures but don't clearly state the current expected behavior. Either remove the outdated comments or clarify what the test is actually validating (e.g., "This test verifies that ElasticMQ rejects messages larger than 1MB even in strict mode").
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…age attribute filtering
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.