From 10786729b6a361d0671e733d3a841999ce26193a Mon Sep 17 00:00:00 2001 From: David Yaffe Date: Tue, 5 Nov 2024 10:33:49 -0500 Subject: [PATCH] add integ test and fix ktlint --- .../Services/AWSSQSIntegrationTests/SQSTests.swift | 12 ++++++++++++ .../customization/AwsQueryModeCustomization.kt | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/IntegrationTests/Services/AWSSQSIntegrationTests/SQSTests.swift b/IntegrationTests/Services/AWSSQSIntegrationTests/SQSTests.swift index c8555aa765c..96aeaa696e7 100644 --- a/IntegrationTests/Services/AWSSQSIntegrationTests/SQSTests.swift +++ b/IntegrationTests/Services/AWSSQSIntegrationTests/SQSTests.swift @@ -41,4 +41,16 @@ class SQSTests: XCTestCase { XCTAssertNotNil(response.queueUrl, "Queue URL should not be nil") XCTAssertTrue(response.queueUrl?.contains(queueName) ?? false, "Queue URL should contain the queue name.") } + + func test_QueryCompatible() async throws { + do { + let response = try await client.getQueueUrl(input: .init(queueName: "non-existent-queue-123")) + XCTFail("Expected an error to be thrown!") + } catch let error as QueueDoesNotExist { + let errorCode = error.errorCode + XCTAssertTrue(errorCode == "AWS.SimpleQueueService.NonExistentQueue") + } catch let unknownError { + XCTFail("An unexpected error occurred: \(unknownError.localizedDescription)") + } + } } diff --git a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/AwsQueryModeCustomization.kt b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/AwsQueryModeCustomization.kt index f28689a07f2..d537466ed6e 100644 --- a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/AwsQueryModeCustomization.kt +++ b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/AwsQueryModeCustomization.kt @@ -31,4 +31,4 @@ class AwsQueryModeCustomization : SwiftIntegration { ) { operationMiddleware.appendMiddleware(operationShape, awsQueryModeHeaderMiddleware) } -} \ No newline at end of file +}