Skip to content

Commit 1a6ca91

Browse files
committed
Fix for detektTest errors.
1 parent 93cd2a7 commit 1a6ca91

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

plugins/amazonq/chat/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/amazonq/clients/AmazonQStreamingClientTest.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ class AmazonQStreamingClientTest : AmazonQTestBase() {
9595
} doAnswer {
9696
attemptCount++
9797
if (attemptCount <= 2) {
98-
CompletableFuture<Void>().apply {
99-
completeExceptionally(VALIDATION_EXCEPTION)
98+
CompletableFuture.runAsync {
99+
throw VALIDATION_EXCEPTION
100100
}
101101
} else {
102102
CompletableFuture.completedFuture(mock())
@@ -117,8 +117,8 @@ class AmazonQStreamingClientTest : AmazonQTestBase() {
117117
exportResultArchive(any<ExportResultArchiveRequest>(), any<ExportResultArchiveResponseHandler>())
118118
} doAnswer {
119119
attemptCount++
120-
CompletableFuture<Void>().apply {
121-
completeExceptionally(VALIDATION_EXCEPTION)
120+
CompletableFuture.runAsync {
121+
throw VALIDATION_EXCEPTION
122122
}
123123
}
124124
}
@@ -142,8 +142,8 @@ class AmazonQStreamingClientTest : AmazonQTestBase() {
142142
exportResultArchive(any<ExportResultArchiveRequest>(), any<ExportResultArchiveResponseHandler>())
143143
} doAnswer {
144144
attemptCount++
145-
CompletableFuture<Void>().apply {
146-
completeExceptionally(IllegalArgumentException("Non-retryable error"))
145+
CompletableFuture.runAsync {
146+
throw IllegalArgumentException("Non-retryable error")
147147
}
148148
}
149149
}
@@ -176,8 +176,8 @@ class AmazonQStreamingClientTest : AmazonQTestBase() {
176176
}
177177
lastAttemptTime = currentTime
178178

179-
CompletableFuture<Void>().apply {
180-
completeExceptionally(VALIDATION_EXCEPTION)
179+
CompletableFuture.runAsync {
180+
throw VALIDATION_EXCEPTION
181181
}
182182
}
183183
}
@@ -201,8 +201,8 @@ class AmazonQStreamingClientTest : AmazonQTestBase() {
201201
on {
202202
exportResultArchive(any<ExportResultArchiveRequest>(), any<ExportResultArchiveResponseHandler>())
203203
} doAnswer {
204-
CompletableFuture<Void>().apply {
205-
completeExceptionally(VALIDATION_EXCEPTION)
204+
CompletableFuture.runAsync {
205+
throw VALIDATION_EXCEPTION
206206
}
207207
}
208208
}

0 commit comments

Comments
 (0)