Skip to content

Commit 2ff9abb

Browse files
committed
tst
1 parent 12d8306 commit 2ff9abb

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ kotlin = "2.1.20"
2424
kotlinCoroutines = "1.8.0"
2525
lsp4j = "0.24.0"
2626
mockito = "5.12.0"
27-
mockitoKotlin = "5.4.0"
27+
mockitoKotlin = "5.4.1-SNAPSHOT"
2828
mockk = "1.13.17"
2929
nimbus-jose-jwt = "9.40"
3030
node-gradle = "7.0.2"

plugins/amazonq/codewhisperer/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/codewhisperer/CodeWhispererTestBase.kt

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import kotlinx.coroutines.Deferred
2020
import kotlinx.coroutines.Job
2121
import kotlinx.coroutines.delay
2222
import kotlinx.coroutines.flow.first
23-
import kotlinx.coroutines.runBlocking
2423
import kotlinx.coroutines.test.runTest
2524
import kotlinx.coroutines.yield
2625
import org.assertj.core.api.Assertions.assertThat
@@ -314,26 +313,26 @@ open class CodeWhispererTestBase {
314313
val psiFileCaptor = argumentCaptor<PsiFile>()
315314
val latencyContextCaptor = argumentCaptor<LatencyContext>()
316315

317-
runBlocking {
318-
whenever(codewhispererService.getRequestContext(
319-
triggerTypeCaptor.capture(),
320-
editorCaptor.capture(),
321-
projectCaptor.capture(),
322-
psiFileCaptor.capture(),
323-
latencyContextCaptor.capture()
316+
doSuspendableAnswer {
317+
val requestContext = codewhispererService.getRequestContext(
318+
triggerTypeCaptor.firstValue,
319+
editorCaptor.firstValue,
320+
projectRule.project,
321+
psiFileCaptor.firstValue,
322+
latencyContextCaptor.firstValue
323+
)
324+
projectRule.fixture.type(userInput)
325+
requestContext
326+
}.doCallRealMethod()
327+
.wheneverBlocking(codewhispererService) {
328+
getRequestContext(
329+
triggerTypeCaptor.capture(),
330+
editorCaptor.capture(),
331+
projectCaptor.capture(),
332+
psiFileCaptor.capture(),
333+
latencyContextCaptor.capture()
324334
)
325-
).doSuspendableAnswer {
326-
val requestContext = codewhispererService.getRequestContext(
327-
triggerTypeCaptor.firstValue,
328-
editorCaptor.firstValue,
329-
projectRule.project,
330-
psiFileCaptor.firstValue,
331-
latencyContextCaptor.firstValue
332-
)
333-
projectRule.fixture.type(userInput)
334-
requestContext
335-
}.thenCallRealMethod()
336-
}
335+
}
337336
}
338337

339338
fun mockLspInlineCompletionResponse(response: InlineCompletionListWithReferences) {

0 commit comments

Comments
 (0)