@@ -63,7 +63,7 @@ class MutliRegionAccessPointTest {
6363 multiRegionAccessPointArn = s3Control.createMultiRegionAccessPoint(
6464 MULTI_REGION_ACCESS_POINT_NAME ,
6565 accountId,
66- listOf (usWestBucket, usEastBucket)
66+ listOf (usWestBucket, usEastBucket),
6767 )
6868 }
6969
@@ -116,13 +116,15 @@ private suspend fun S3ControlClient.createMultiRegionAccessPoint(
116116): String {
117117 println (" Creating multi-region access point: $name " )
118118
119- val requestTokenArn = checkNotNull(createMultiRegionAccessPoint {
120- this .accountId = accountId
121- details {
122- this .name = name
123- this .regions = buckets.map { Region { bucket = it } }
124- }
125- }.requestTokenArn) { " createMultiRegionAccessPoint requestTokenArn was unexpectedly null" }
119+ val requestTokenArn = checkNotNull(
120+ createMultiRegionAccessPoint {
121+ this .accountId = accountId
122+ details {
123+ this .name = name
124+ this .regions = buckets.map { Region { bucket = it } }
125+ }
126+ }.requestTokenArn,
127+ ) { " createMultiRegionAccessPoint requestTokenArn was unexpectedly null" }
126128
127129 waitUntilOperationCompletes(" createMultiRegionAccessPoint" , accountId, requestTokenArn, 10 .minutes)
128130
@@ -131,28 +133,28 @@ private suspend fun S3ControlClient.createMultiRegionAccessPoint(
131133
132134private suspend fun S3ControlClient.getMultiRegionAccessPointArn (
133135 name : String ,
134- accountId : String
135- ): String {
136- return getMultiRegionAccessPoint {
137- this .name = name
138- this .accountId = accountId
139- }.accessPoint?.alias?.let {
140- " arn:aws:s3::$accountId :accesspoint/$it "
141- } ? : throw IllegalStateException (" Failed to get ARN for multi-region access point $name " )
142- }
136+ accountId : String ,
137+ ): String = getMultiRegionAccessPoint {
138+ this .name = name
139+ this .accountId = accountId
140+ }.accessPoint?.alias?.let {
141+ " arn:aws:s3::$accountId :accesspoint/$it "
142+ } ? : throw IllegalStateException (" Failed to get ARN for multi-region access point $name " )
143143
144144private suspend fun S3ControlClient.deleteMultiRegionAccessPoint (
145145 name : String ,
146- accountId : String
146+ accountId : String ,
147147) {
148148 println (" Deleting multi-region access point $name " )
149149
150- val requestTokenArn = checkNotNull(deleteMultiRegionAccessPoint {
151- this .accountId = accountId
152- details {
153- this .name = name
154- }
155- }.requestTokenArn) { " deleteMultiRegionAccessPoint requestTokenArn was unexpectedly null" }
150+ val requestTokenArn = checkNotNull(
151+ deleteMultiRegionAccessPoint {
152+ this .accountId = accountId
153+ details {
154+ this .name = name
155+ }
156+ }.requestTokenArn,
157+ ) { " deleteMultiRegionAccessPoint requestTokenArn was unexpectedly null" }
156158
157159 waitUntilOperationCompletes(" deleteMultiRegionAccessPoint" , accountId, requestTokenArn, 5 .minutes)
158160}
@@ -190,4 +192,4 @@ private suspend fun S3ControlClient.waitUntilOperationCompletes(
190192
191193 delay(10 .seconds) // Avoid constant status checks
192194 }
193- }
195+ }
0 commit comments