You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: services/route53/e2eTest/src/InvalidChangeBatchTest.kt
+40-39Lines changed: 40 additions & 39 deletions
Original file line number
Diff line number
Diff line change
@@ -26,49 +26,50 @@ class InvalidChangeBatchTest {
26
26
27
27
val hostedZoneId = checkNotNull(createHostedZoneResp.hostedZone?.id) { "Hosted zone is unexpectedly null" }
28
28
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
+
}
62
64
}
63
65
}
64
-
}
65
66
66
-
client.deleteHostedZone {
67
-
id = hostedZoneId
67
+
assertNotNull(exception.message)
68
+
} finally {
69
+
client.deleteHostedZone {
70
+
id = hostedZoneId
71
+
}
68
72
}
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.]")
0 commit comments