-
Notifications
You must be signed in to change notification settings - Fork 55
fix: remove InvalidChangeBatch customization #1435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
352ef1c
Remove InvalidChangeBatch customization
lauzadis 4cc6946
revert test deletion
lauzadis be60729
Changelog
lauzadis 9740446
error response
lauzadis dadf763
Add E2E test
lauzadis b084874
Configure region
lauzadis 142eec9
Change error message
lauzadis 1f61f00
Remove println
lauzadis acc251c
Remove assertion on error message contents
lauzadis 9d04768
ktlint
lauzadis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,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" | ||
| ] | ||
| } |
42 changes: 0 additions & 42 deletions
42
.../kotlin/codegen/customization/route53/ChangeResourceRecordSetsUnmarshallingIntegration.kt
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
40 changes: 0 additions & 40 deletions
40
...lin/codegen/customization/route53/ChangeResourceRecordSetsUnmarshallingIntegrationTest.kt
This file was deleted.
Oops, something went wrong.
49 changes: 0 additions & 49 deletions
49
...mon/src/aws/sdk/kotlin/services/route53/internal/ChangeResourceRecordSetsUnmarshalling.kt
This file was deleted.
Oops, something went wrong.
109 changes: 0 additions & 109 deletions
109
...est/aws/sdk/kotlin/services/route53/internal/ChangeResourceRecordSetsUnmarshallingTest.kt
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,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.assertContains | ||
| 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" } | ||
|
|
||
| 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..." | ||
| } | ||
| } | ||
| } | ||
|
|
||
| client.deleteHostedZone { | ||
| id = hostedZoneId | ||
| } | ||
|
|
||
| assertNotNull(exception.message) | ||
| assertContains(exception.message, "[Tried to delete resource record set [name='test.blerg.com.', type='CNAME'] but it was not found, RRSet with DNS name test.blerg.com. is not permitted in zone this-is-a-test-hosted-zone-for-aws-sdk-kotlin.com., RRSet of type CNAME with DNS name test.blerg.com. is not permitted as it creates a CNAME loop in the zone.]") | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Asserting on specific exception messages which we do not control is brittle and prone to breakage. Simply deserializing the correct exception should be sufficient for our testing. Users should be catching/handling exceptions based on type anyways—not based on message.