aws / aws-sdk-java-v2

The official AWS SDK for Java - Version 2
Apache License 2.0
2.16k stars 840 forks source link

Integeration tests for SQS Automatic Request Batching #5576

Closed joviegas closed 2 weeks ago

joviegas commented 3 weeks ago

Motivation and Context

Summary of Testing in RequestBatchManagerSqsIntegrationTest

This test class performs integration testing for AWS SQS batch manager, covering various message sending, receiving, and management scenarios using SQS.

Scenarios Covered:

  1. Basic Message Sending:

    • sendTenMessages: Sends 10 messages to a queue.
    • sendTwentyMessages: Sends 20 messages to a queue.
  2. Batching and Scheduling:

    • scheduleSendFiveMessages: Sends 5 messages in a batch and checks batch processing time.
    • scheduleTwoSendMessageBatches: Sends 10 messages in two batches and checks batch behavior.
  3. Multi-threaded Message Sending:

    • sendMultipleMessagesWithMultiThread: Sends messages using multiple threads and verifies concurrency.
  4. Messages to Different Queues:

    • scheduleFiveMessagesWithEachThreadToDifferentLocations: Sends messages to different queues from multiple threads.
  5. Message Deletion:

    • deleteMessages: Sends and deletes messages, ensuring batch deletion works.
  6. Visibility Timeout Change:

    • changeVisibilityMessages: Changes visibility timeout of messages after sending.
  7. Large Message Handling:

    • sendMessagesWhichCanExceed256KiBCollectively: Sends large messages (256 KiB) and verifies correct handling.
  8. Queue Management:

    • createSendMessageRequestsForDifferentDestinations: Creates multiple queues and sends messages to them.

Key Features:

Summary of Testing in ResponseBatchManagerSqsIntegrationTest

This test class performs integration testing for AWS SQS response batch manager, focusing on message sending, receiving, and processing via SQS.

Scenarios Covered:

  1. Basic Message Receiving:

    • simpleReceiveMessagesWithDefaultConfiguration: Sends 10 messages and receives them with default batch manager settings. Ensures no message attributes or system attributes are present.
  2. Custom Configuration for Message Receiving:

    • simpleReceiveMessagesWithCustomConfigurations: Tests receiving messages with custom configurations (e.g., wait time, message attributes). Ensures message attributes and system attributes are correctly processed.
  3. Request-Level Max Message and Wait Time Handling:

    • requestLevelMaxMessageAndWaitTimeIsHonoured: Ensures the request-level configurations like maxNumberOfMessages and waitTimeSeconds are respected when receiving and processing messages. Verifies message deletion after receiving each message.

Key Features:

License

sonarcloud[bot] commented 3 weeks ago

Quality Gate Failed Quality Gate failed

Failed conditions
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint