-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
860 additions
and
180 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
IntegrationTests/Services/AWSSQSIntegrationTests/SQSTests.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
import XCTest | ||
import AWSSQS | ||
import ClientRuntime | ||
|
||
/// Tests AWS SQS queue creation and deletion. | ||
class SQSTests: XCTestCase { | ||
|
||
private var client: SQSClient! | ||
private var queueName: String! | ||
private var queueUrl: String? | ||
|
||
override func setUp() async throws { | ||
client = try await SQSClient() | ||
queueName = "integration-test-queue-\(UUID().uuidString)" | ||
} | ||
|
||
override func tearDown() async throws { | ||
if let queueUrl = queueUrl { | ||
do { | ||
_ = try await client.deleteQueue(input: .init(queueUrl: queueUrl)) | ||
} catch { | ||
XCTFail("Error in tearDown: \(error)") | ||
} | ||
} | ||
// Else, nothing to clean up as the queue was not created. | ||
} | ||
|
||
func test_QueueCreation() async throws { | ||
let response = try await client.createQueue(input: .init(queueName: queueName)) | ||
queueUrl = response.queueUrl | ||
|
||
XCTAssertNotNil(response.queueUrl, "Queue URL should not be nil") | ||
XCTAssertTrue(response.queueUrl?.contains(queueName) ?? false, "Queue URL should contain the queue name.") | ||
} | ||
} |
Oops, something went wrong.