Skip to content

Commit

Permalink
update SQS to latest model that uses aws json protocol + add integrat…
Browse files Browse the repository at this point in the history
…ion test
  • Loading branch information
dayaffe committed Nov 22, 2023
1 parent 268a4e2 commit 60cb4bb
Show file tree
Hide file tree
Showing 5 changed files with 3,684 additions and 1,454 deletions.
42 changes: 42 additions & 0 deletions IntegrationTests/Services/AWSSQSIntegrationTests/SQSTests.swift
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.")
}
}
Loading

0 comments on commit 60cb4bb

Please sign in to comment.