@@ -60,7 +60,6 @@ import software.aws.toolkits.jetbrains.utils.rules.HeavyJavaCodeInsightTestFixtu
6060import software.aws.toolkits.jetbrains.utils.rules.addClass
6161import software.aws.toolkits.jetbrains.utils.rules.addModule
6262import software.aws.toolkits.jetbrains.utils.rules.addTestClass
63- import java.util.concurrent.atomic.AtomicBoolean
6463import kotlin.test.assertNotNull
6564
6665class CodeWhispererFileContextProviderTest {
@@ -231,26 +230,6 @@ class CodeWhispererFileContextProviderTest {
231230 assertThat(serverContext.constructed()).hasSize(1 )
232231
233232 whenever(providerContext.constructed()[0 ].queryInline(any(), any(), any())).thenThrow(RuntimeException (" mock exception" ))
234- whenever(providerContext.constructed()[0 ].isIndexComplete).thenReturn(AtomicBoolean (true ))
235-
236- val result = controller.queryInline(" query" , " filePath" )
237- assertThat(result).isEmpty()
238- }
239- }
240- }
241-
242- @Test
243- fun `projectContextController should return empty result if index is not ready` () = runTest {
244- mockConstruction(ProjectContextProvider ::class .java).use { providerContext ->
245- mockConstruction(EncoderServer ::class .java).use { serverContext ->
246- assertThat(providerContext.constructed()).hasSize(0 )
247- assertThat(serverContext.constructed()).hasSize(0 )
248- val controller = ProjectContextController (project, TestScope ())
249- assertThat(providerContext.constructed()).hasSize(1 )
250- assertThat(serverContext.constructed()).hasSize(1 )
251-
252- whenever(providerContext.constructed()[0 ].queryInline(any(), any(), any())).thenReturn(listOf (InlineBm25Chunk (" foo" , " path" , 0.0 )))
253- whenever(providerContext.constructed()[0 ].isIndexComplete).thenReturn(AtomicBoolean (false ))
254233
255234 val result = controller.queryInline(" query" , " filePath" )
256235 assertThat(result).isEmpty()
0 commit comments