Skip to content

Commit

Permalink
fix: remove InvalidChangeBatch customization (#1435)
Browse files Browse the repository at this point in the history
  • Loading branch information
lauzadis authored Oct 11, 2024
1 parent 650f7b2 commit 7f5f09b
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 241 deletions.
8 changes: 8 additions & 0 deletions .changes/a9deee4f-8f15-472c-906f-492066275178.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "a9deee4f-8f15-472c-906f-492066275178",
"type": "bugfix",
"description": "Remove Route53 InvalidChangeBatch error response customization",
"issues": [
"https://github.com/awslabs/aws-sdk-kotlin/issues/1433"
]
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ aws.sdk.kotlin.codegen.customization.glacier.GlacierBodyChecksum
aws.sdk.kotlin.codegen.customization.polly.PollyPresigner
aws.sdk.kotlin.codegen.customization.machinelearning.MachineLearningEndpointCustomization
aws.sdk.kotlin.codegen.customization.route53.TrimResourcePrefix
aws.sdk.kotlin.codegen.customization.route53.ChangeResourceRecordSetsUnmarshallingIntegration
aws.sdk.kotlin.codegen.customization.ec2.EC2MakePrimitivesOptional
aws.sdk.kotlin.codegen.customization.RemoveDefaults
aws.sdk.kotlin.codegen.customization.s3.UnsupportedSigningAlgorithmIntegration
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

74 changes: 74 additions & 0 deletions services/route53/e2eTest/src/InvalidChangeBatchTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
package aws.sdk.kotlin.services.route53

import aws.sdk.kotlin.services.route53.model.*
import aws.smithy.kotlin.runtime.util.Uuid
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertFailsWith
import kotlin.test.assertNotNull

// https://github.com/awslabs/aws-sdk-kotlin/issues/1433
class InvalidChangeBatchTest {
@Test
fun testMessageIsPopulated() = runTest {
Route53Client {
region = "us-east-1"
}.use { client ->
val createHostedZoneResp = client.createHostedZone {
this.callerReference = Uuid.random().toString()
this.name = "this-is-a-test-hosted-zone-for-aws-sdk-kotlin.com"
}

val hostedZoneId = checkNotNull(createHostedZoneResp.hostedZone?.id) { "Hosted zone is unexpectedly null" }

try {
val exception = assertFailsWith<InvalidChangeBatch> {
client.changeResourceRecordSets {
this.hostedZoneId = hostedZoneId
this.changeBatch = ChangeBatch {
this.changes = listOf(
Change {
this.action = ChangeAction.Delete
this.resourceRecordSet = ResourceRecordSet {
this.name = "test.blerg.com"
this.type = RrType.Cname
this.ttl = 300
this.resourceRecords = listOf(
ResourceRecord {
value = "test.blerg.com"
},
)
}
},
Change {
this.action = ChangeAction.Create
this.resourceRecordSet = ResourceRecordSet {
this.name = "test.blerg.com"
this.type = RrType.Cname
this.ttl = 300
this.resourceRecords = listOf(
ResourceRecord {
value = "test.blerg.com"
},
)
}
},
)
this.comment = "testing..."
}
}
}

assertNotNull(exception.message)
} finally {
client.deleteHostedZone {
id = hostedZoneId
}
}
}
}
}

0 comments on commit 7f5f09b

Please sign in to comment.