Skip to content

Scala integration tests refactoring#1195

Merged
micossow merged 15 commits intomasterfrom
aws-tests-refactoring
Feb 22, 2026
Merged

Scala integration tests refactoring#1195
micossow merged 15 commits intomasterfrom
aws-tests-refactoring

Conversation

@micossow
Copy link
Contributor

No description provided.

…test structure, updating to AWS SDK v2 clients
…, simplifying configuration and reusing shared logic
…e and utilize SQSRestServerWithSdkV2Client, reorganizing server/client lifecycle logic
…egrationTestsBase` and reorganize packages for consistency and better structure
Copy link

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 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.client to org.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.

@micossow micossow marked this pull request as ready for review February 22, 2026 17:00
@micossow micossow merged commit 80672e2 into master Feb 22, 2026
23 checks passed
@micossow micossow deleted the aws-tests-refactoring branch February 22, 2026 17:00
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