Skip to content

Commit acc251c

Browse files
committed
Remove assertion on error message contents
1 parent 1f61f00 commit acc251c

File tree

1 file changed

+40
-39
lines changed

1 file changed

+40
-39
lines changed

services/route53/e2eTest/src/InvalidChangeBatchTest.kt

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -26,49 +26,50 @@ class InvalidChangeBatchTest {
2626

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

29-
val exception = assertFailsWith<InvalidChangeBatch> {
30-
client.changeResourceRecordSets {
31-
this.hostedZoneId = hostedZoneId
32-
this.changeBatch = ChangeBatch {
33-
this.changes = listOf(
34-
Change {
35-
this.action = ChangeAction.Delete
36-
this.resourceRecordSet = ResourceRecordSet {
37-
this.name = "test.blerg.com"
38-
this.type = RrType.Cname
39-
this.ttl = 300
40-
this.resourceRecords = listOf(
41-
ResourceRecord {
42-
value = "test.blerg.com"
43-
},
44-
)
45-
}
46-
},
47-
Change {
48-
this.action = ChangeAction.Create
49-
this.resourceRecordSet = ResourceRecordSet {
50-
this.name = "test.blerg.com"
51-
this.type = RrType.Cname
52-
this.ttl = 300
53-
this.resourceRecords = listOf(
54-
ResourceRecord {
55-
value = "test.blerg.com"
56-
},
57-
)
58-
}
59-
},
60-
)
61-
this.comment = "testing..."
29+
try {
30+
val exception = assertFailsWith<InvalidChangeBatch> {
31+
client.changeResourceRecordSets {
32+
this.hostedZoneId = hostedZoneId
33+
this.changeBatch = ChangeBatch {
34+
this.changes = listOf(
35+
Change {
36+
this.action = ChangeAction.Delete
37+
this.resourceRecordSet = ResourceRecordSet {
38+
this.name = "test.blerg.com"
39+
this.type = RrType.Cname
40+
this.ttl = 300
41+
this.resourceRecords = listOf(
42+
ResourceRecord {
43+
value = "test.blerg.com"
44+
},
45+
)
46+
}
47+
},
48+
Change {
49+
this.action = ChangeAction.Create
50+
this.resourceRecordSet = ResourceRecordSet {
51+
this.name = "test.blerg.com"
52+
this.type = RrType.Cname
53+
this.ttl = 300
54+
this.resourceRecords = listOf(
55+
ResourceRecord {
56+
value = "test.blerg.com"
57+
},
58+
)
59+
}
60+
},
61+
)
62+
this.comment = "testing..."
63+
}
6264
}
6365
}
64-
}
6566

66-
client.deleteHostedZone {
67-
id = hostedZoneId
67+
assertNotNull(exception.message)
68+
} finally {
69+
client.deleteHostedZone {
70+
id = hostedZoneId
71+
}
6872
}
69-
70-
assertNotNull(exception.message)
71-
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.]")
7273
}
7374
}
7475
}

0 commit comments

Comments
 (0)