Skip to content

chore: improve test coverage for ConnectionStateViewModel #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -441,7 +441,11 @@ internal fun mockLogMessage() =
* @param url
* @return
*/
internal fun mockDataSource(url: MongoDbServerUrl = MongoDbServerUrl("mongodb://localhost:27017")) =
internal fun mockDataSource(
url: MongoDbServerUrl = MongoDbServerUrl("mongodb://localhost:27017"),
name: String? = null,
uniqueId: String? = null,
) =
mock<LocalDataSource>().also { dataSource ->
val driver = mock<DatabaseDriver>()
`when`(driver.id).thenReturn("mongo")
@@ -450,8 +454,12 @@ internal fun mockDataSource(url: MongoDbServerUrl = MongoDbServerUrl("mongodb://
`when`(dataSource.databaseDriver).thenReturn(driver)
`when`(dataSource.dbms).thenReturn(Dbms.MONGO)
val testClass = Thread.currentThread().stackTrace[2].className
`when`(dataSource.name).thenReturn(testClass + "_" + UUID.randomUUID().toString())
`when`(dataSource.uniqueId).thenReturn(testClass + "_" + UUID.randomUUID().toString())
`when`(dataSource.name).thenReturn(
name ?: (testClass + "_" + UUID.randomUUID().toString())
)
`when`(dataSource.uniqueId).thenReturn(
uniqueId ?: (testClass + "_" + UUID.randomUUID().toString())
)
}

/**
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ import com.mongodb.jbplugin.fixtures.readClipboard
import com.mongodb.jbplugin.fixtures.setContentWithTheme
import com.mongodb.jbplugin.ui.viewModel.ConnectionState
import com.mongodb.jbplugin.ui.viewModel.DatabaseState
import com.mongodb.jbplugin.ui.viewModel.DatabasesLoadingState
import com.mongodb.jbplugin.ui.viewModel.SelectedConnectionState
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertTrue
@@ -237,4 +238,106 @@ class ConnectionBootstrapCardTest {
onNodeWithTag("DisconnectItem").performClick()
assertTrue(clicked)
}

@Test
fun `shows selected database when one is selected`() = runComposeUiTest {
val dataSource = mockDataSource()

setContentWithTheme {
_ConnectionBootstrapCard(
ConnectionState(
listOf(dataSource),
dataSource,
SelectedConnectionState.Connected(dataSource)
),
DatabaseState(
databasesLoadingState = DatabasesLoadingState.Loaded(dataSource, listOf("testDB")),
selectedDatabase = "testDB"
)
)
}

onNodeWithTag("DatabaseComboBox").assertTextEquals("testDB")
}

@Test
fun `shows loading databases state when fetching databases`() = runComposeUiTest {
val dataSource = mockDataSource()

setContentWithTheme {
_ConnectionBootstrapCard(
ConnectionState(
listOf(dataSource),
dataSource,
SelectedConnectionState.Connected(dataSource)
),
DatabaseState(
databasesLoadingState = DatabasesLoadingState.Loading(dataSource),
selectedDatabase = null
)
)
}

onNodeWithTag("DatabaseComboBox").assertTextEquals("Loading databases...")
}

@Test
fun `handles database selection through UI`() = runComposeUiTest {
val dataSource = mockDataSource()
var selectedDatabase: String? = null

setContentWithTheme {
CompositionLocalProvider(
LocalDatabaseCallbacks provides DatabaseCallbacks(
selectDatabase = { selectedDatabase = it }
)
) {
_ConnectionBootstrapCard(
ConnectionState(
listOf(dataSource),
dataSource,
SelectedConnectionState.Connected(dataSource)
),
DatabaseState(
databasesLoadingState = DatabasesLoadingState.Loaded(dataSource, listOf("testDB")),
selectedDatabase = null
)
)
}
}

onNodeWithTag("DatabaseComboBox").performClick()
onNodeWithTag("DatabaseItem::testDB").performClick()
assertEquals("testDB", selectedDatabase)
}

@Test
fun `handles database unselection through UI`() = runComposeUiTest {
val dataSource = mockDataSource()
var unselectClicked = false

setContentWithTheme {
CompositionLocalProvider(
LocalDatabaseCallbacks provides DatabaseCallbacks(
unselectSelectedDatabase = { unselectClicked = true }
)
) {
_ConnectionBootstrapCard(
ConnectionState(
listOf(dataSource),
dataSource,
SelectedConnectionState.Connected(dataSource)
),
DatabaseState(
databasesLoadingState = DatabasesLoadingState.Loaded(dataSource, listOf("testDB")),
selectedDatabase = "testDB"
)
)
}
}

onNodeWithTag("DatabaseComboBox").performClick()
onNodeWithTag("UnselectItem").performClick()
assertTrue(unselectClicked)
}
}
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.advanceUntilIdle
import kotlinx.coroutines.test.runTest
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertFalse
import org.junit.jupiter.api.Assertions.assertTrue
@@ -421,4 +422,137 @@ class ConnectionStateViewModelTest {
assertInstanceOf<DatabasesLoadingState.Failed>(viewModel.databaseState.value.databasesLoadingState)
}
}

@Test
fun `when a data source is changed, it updates the connection list and reconnects if selected`(
project: Project,
coroutineScope: TestScope,
) {
val viewModel = ConnectionStateViewModel(project, coroutineScope)
viewModel.connectionSaga = mock()
val dataSourceManager = mock<DataSourceManager<LocalDataSource>>()
val updatedDataSource = mockDataSource(name = dataSource.name, uniqueId = dataSource.uniqueId)

runBlocking {
viewModel.selectConnection(dataSource)
assertEquals(dataSource, viewModel.connectionState.value.selectedConnection)
}

viewModel.dataSourceChanged(dataSourceManager, updatedDataSource)

eventually {
coroutineScope.advanceUntilIdle()
assertTrue(viewModel.connectionState.value.connections.any { it.uniqueId == updatedDataSource.uniqueId })
assertEquals(updatedDataSource, viewModel.connectionState.value.selectedConnection)
verify(viewModel.connectionSaga, timeout(1000)).connect(updatedDataSource)
}
}

@Test
fun `when selecting a database, it updates preferences and triggers editor reanalysis`(
project: Project,
coroutineScope: TestScope,
) {
val viewModel = ConnectionStateViewModel(project, coroutineScope)
viewModel.connectionSaga = mock()

runBlocking {
viewModel.selectDatabase("testDB")
}

eventually {
coroutineScope.advanceUntilIdle()
assertEquals("testDB", viewModel.databaseState.value.selectedDatabase)
assertEquals("testDB", connectionPreferences.database)
verify(editorService, timeout(1000)).reAnalyzeSelectedEditor(true)
}
}

@Test
fun `when unselecting a database, it clears preferences and triggers editor reanalysis`(
project: Project,
coroutineScope: TestScope,
) {
val viewModel = ConnectionStateViewModel(project, coroutineScope)
viewModel.connectionSaga = mock()

runBlocking {
viewModel.selectDatabase("testDB")
viewModel.unselectSelectedDatabase()
}

eventually {
coroutineScope.advanceUntilIdle()
assertEquals(null, viewModel.databaseState.value.selectedDatabase)
assertEquals(null, connectionPreferences.database)
verify(editorService, timeout(1000).times(2)).reAnalyzeSelectedEditor(true)
}
}

@Test
fun `when adding a new connection, it selects the connection if successfully created`(
project: Project,
coroutineScope: TestScope,
) = runTest {
val viewModel = ConnectionStateViewModel(project, coroutineScope)
val newDataSource = mockDataSource()
whenever(connectionSaga.addNewConnection()).thenReturn(newDataSource)
viewModel.connectionSaga = connectionSaga

runBlocking {
viewModel.addNewConnection()
}

eventually {
coroutineScope.advanceUntilIdle()
assertEquals(newDataSource, viewModel.connectionState.value.selectedConnection)
verify(connectionSaga, timeout(1000)).connect(newDataSource)
}
}

@Test
fun `when connection fails, it updates state with error message`(
project: Project,
coroutineScope: TestScope,
) {
val viewModel = ConnectionStateViewModel(project, coroutineScope)
val realConnectionSaga = viewModel.connectionSaga
val errorMessage = "Connection failed"
whenever(connectionSaga.connect(dataSource)).then {
coroutineScope.launch {
realConnectionSaga.emitSelectedConnectionStateChange(
SelectedConnectionState.Failed(dataSource, errorMessage)
)
}
}
viewModel.connectionSaga = connectionSaga

runBlocking {
viewModel.selectConnection(dataSource)
}

eventually {
coroutineScope.advanceUntilIdle()
val state = viewModel.connectionState.value.selectedConnectionState
assertInstanceOf<SelectedConnectionState.Failed>(state)
assertEquals(errorMessage, (state as SelectedConnectionState.Failed).errorMessage)
}
}

@Test
fun `when tool window is shown multiple times, it only loads initial state once`(
project: Project,
coroutineScope: TestScope,
) {
val viewModel = ConnectionStateViewModel(project, coroutineScope)
viewModel.connectionSaga = connectionSaga

viewModel.toolWindowShown(mongoDBToolWindow)
viewModel.toolWindowShown(mongoDBToolWindow)

eventually {
coroutineScope.advanceUntilIdle()
verify(connectionSaga, timeout(1000).times(1)).listMongoDbConnections()
}
}
}

Unchanged files with check annotations Beta

package com.mongodb.jbplugin.dialects.springquery

Check failure on line 1 in packages/mongodb-dialects/spring-@query/src/test/kotlin/com/mongodb/jbplugin/dialects/springquery/SpringAtQueryDialectParserTest.kt

GitHub Actions / JUnit Test Report

SpringAtQueryDialectParserTest.initializationError

java.lang.RuntimeException: java.lang.IllegalStateException: No roots for 'org.springframework.data:spring-data-mongodb:4.3.2'
Raw output
java.lang.RuntimeException: java.lang.IllegalStateException: No roots for 'org.springframework.data:spring-data-mongodb:4.3.2'
	at com.intellij.testFramework.LightPlatformTestCase.initProject(LightPlatformTestCase.java:203)
	at com.intellij.testFramework.LightPlatformTestCase.lambda$doSetup$3(LightPlatformTestCase.java:261)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread$lambda$2(AnyThreadWriteThreadingSupport.kt:217)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread(AnyThreadWriteThreadingSupport.kt:216)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:842)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:395)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:446)
	at com.intellij.testFramework.LightPlatformTestCase.doSetup(LightPlatformTestCase.java:252)
	at com.intellij.testFramework.fixtures.impl.LightIdeaTestFixtureImpl.setUp(LightIdeaTestFixtureImpl.java:41)
	at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.lambda$setUp$38(CodeInsightTestFixtureImpl.java:1381)
	at com.intellij.testFramework.EdtTestUtil.lambda$runInEdtAndWait$5(EdtTestUtil.java:91)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:236)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:25)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:198)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread$lambda$2(AnyThreadWriteThreadingSupport.kt:217)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread(AnyThreadWriteThreadingSupport.kt:216)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:842)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:421)
	at com.intellij.openapi.application.impl.AppImplKt.rethrowExceptions$lambda$2(appImpl.kt:57)
	at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101)
	at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101)
	at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:107)
	at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:101)
	at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
	at com.intellij.openapi.application.impl.AppImplKt.rethrowExceptions$lambda$3(appImpl.kt:68)
	at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:102)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:117)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:675)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:573)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16(IdeEventQueue.kt:351)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$2$lambda$1(IdeEventQueue.kt:1045)
	at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:916)
	at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55)
	at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$2(IdeEventQueue.kt:1045)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:1054)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:109)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1054)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18(IdeEventQueue.kt:349)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:395)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
	Suppressed: java.lang.RuntimeException: java.lang.NullPointerException: Parameter specified as non-null is null: method com.intellij.testFramework.IndexingTestUtil$Companion.waitUntilIndexesAreReady, parameter project
		at com.intellij.openapi.application.impl.LaterInvocator.invokeAndWait(LaterInvocator.java:133)
		at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:411)
		at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:446)
		at com.mongodb.jbplugin.dialects.springquery.IntegrationTestExtension.afterAll(IntegrationTest.kt:216)
		at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeAfterAllCallbacks$18(ClassBasedTestDescriptor.java:462)
		at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
		at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeAfterAllCallbacks$19(ClassBasedTestDescriptor.java:462)
		at org.junit.platform.commons.util.CollectionUtils.forEachInReverseOrder(CollectionUtils.java:217)
		at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeAfterAllCallbacks(ClassBasedTestDescriptor.java:461)
		at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.after(ClassBasedTestDescriptor.java:236)
		at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.after(ClassBasedTestDescriptor.java:85)
		at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:161)
		at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
		at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:161)
		at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
		at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
		at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
		at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
		at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
		at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
		at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
		at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
		at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
		at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
		at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
		at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
		at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
		at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
		at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
		at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
		at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
		at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
		at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
		at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
		at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
		at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
		at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
		at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
		at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
		at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
		at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:119)
		at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:94)
		at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:89)
		at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:62)
		at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
		at java.base/java.lang.reflect.Method.invoke(Method.java:580)
		at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
		at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
		at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
		at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
		at jdk.proxy2/jdk.proxy2.$Proxy6.stop(Unknown Source)
		at org.gradle.api.internal.tasks.testing.worker.TestWorker$3.run(TestWorker.java:193)
		at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
		at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
		at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
		at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
		at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:113)
		at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:65)
		at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
		at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
	Caused by: java.lang.NullPointerException: Parameter specified as non-null is null: method com.intellij.testFramework.IndexingTestUtil$Companion.waitUntilIndexesAreReady, parameter project
		at com.intellij.testFramework.IndexingTestUtil$Companion.waitUntilIndexesAreReady(IndexingTestUtil.kt)
		at com.intellij.testFramework.IndexingTestUtil.waitUntilIndexesAreReady(IndexingTestUtil.kt)
		at com.intellij.testFramework.fixtures.impl.LightIdeaTestFixtureImpl.lambda$tearDown$3(LightIdeaTestFixtureImpl.java:74)
		at com.intellij.testFramework.RunAll$Companion$actionSequence$1$1.invoke(RunAll.kt:72)
		at com.intellij.testFramework.RunAll$Companion$actionSequence$1$1.invoke(RunAll.kt:72)
		at com.intellij.testFramework.common.RunAllKt.runAllCatching(runAll.kt:56)
		at com.intellij.testFramework.common.RunAllKt.runAll(runAll.kt:32)
		at com.intellij.testFramework.RunAll.run(RunAll.kt:21)
		at com.intellij.testFramework.fixtures.impl.LightIdeaTestFixtureImpl.tearDown(LightIdeaTestFixtureImpl.java:109)
		at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.lambda$tearDown$43(CodeInsightTestFixtureImpl.java:1469)
		at com.intellij.testFramework.EdtTestUtil.lambda$runInEdtAndWait$1(EdtTestUtil.java:51)
		at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128)
		at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:916)
		at com.intellij.testFramework.EdtTestUtil.runInEdtAndWait(EdtTestUtil.java:50)
		at com.intellij.testFramework.EdtTestUtil.runInEdtAndWait(EdtTestUtil.java:40)
		at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.lambda$tearDown$44(CodeInsightTestFixtureImpl.java:1469)
		at com.intellij.testFramework.RunAll$Companion$actionSequence$1$1.invoke(RunAll.kt:72)
		at com.intellij.testFramework.RunAll$Companion$actionSequence$1$1.invoke(RunAll.kt:72)
		at com.intellij.testFramework.common.RunAllKt.runAllCatching(runAll.kt:56)
		at com.intellij.testFramework.common.RunAllKt.runAll(runAll.kt:32)
		at com.intellij.testFramework.RunAll$Companion.runAll(RunAll.kt:45)
		at com.intellij.testFramework.RunAll.runAll(RunAll.kt)
		at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.tearDown(CodeInsightTestFixtureImpl.java:1426)
		at com.mongodb.jbplugin.dialects.springquery.IntegrationTestExtension.afterAll$lambda$3(IntegrationTest.kt:217)
		at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:236)
		at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:25)
		at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:198)
		at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread$lambda$2(AnyThreadWriteThreadingSupport.kt:217)
		at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128)
		at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread(AnyThreadWriteThreadingSupport.kt:216)
		at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:842)
		at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:421)
		at com.intellij.openapi.application.impl.AppImplKt.rethrowExceptions$lambda$2(appImpl.kt:57)
		at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101)
		at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101)
		at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:107)
		at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:101)
		at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
		at com.intellij.openapi.application.impl.AppImplKt.rethrowExceptions$lambda$3(appImpl.kt:68)
		at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:102)
		at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:117)
		at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)
		at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
		at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
		at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
		at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
		at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
		at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
		at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)
		at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:675)
		at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:573)
		at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16$lambda$15(IdeEventQueue.kt:355)
		at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:857)
		at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16(IdeEventQueue.kt:354)
		at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$2$lambda$1(IdeEventQueue.kt:1045)
		at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
		at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128)
		at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:916)
		at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55)
		at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23)
		at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$2(IdeEventQueue.kt:1045)
		at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:1054)
		at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:109)
		at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1054)
		at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18(IdeEventQueue.kt:349)
		at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:395)
		at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
		at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
		at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
		at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
		at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
		at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
Caused by: java.lang.IllegalStateException: No roots for 'org.springframework.data:spring-data-mongodb:4.3.2'
	at com.intellij.testFramework.fixtures.MavenDependencyUtil.addFromMaven(MavenDependencyUtil.java:94)
	at com.intellij.testFramework.fixtures.MavenDependencyUtil.addFromMaven(MavenDependencyUtil.java:70)
	at com.intellij.testFramework.fixtures.MavenDependencyUtil.addFromMaven(MavenDependencyUtil.java:57)
	at com.intellij.testFramework.fixtures.MavenDependencyUtil.addFromMaven(MavenDependencyUtil.java:42)
	at com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor.configureModule(DefaultLightProjectDescriptor.java:58)
	at com.mongodb.jbplugin.dialects.springquery.MongoDbProjectDescriptor.configureModule(IntegrationTest.kt:292)
	at com.intellij.testFramework.LightProjectDescriptor.lambda$createContentEntry$2(LightProjectDescriptor.java:145)
	at com.intellij.openapi.roots.ModuleRootModificationUtil.lambda$updateModel$9(ModuleRootModificationUtil.java:155)
	at com.intellij.openapi.roots.ModuleRootModificationUtil.modifyModel(ModuleRootModificationUtil.java:163)
	at com.intellij.openapi.roots.ModuleRootModificationUtil.updateModel(ModuleRootModificationUtil.java:154)
	at com.intellij.testFramework.LightProjectDescriptor.createContentEntry(LightProjectDescriptor.java:134)
	at com.intellij.testFramework.LightProjectDescriptor.lambda$setUpProject$0(LightProjectDescriptor.java:49)
	at com.intellij.openapi.application.WriteAction.lambda$run$1(WriteAction.java:85)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:389)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:383)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:906)
	at com.intellij.openapi.application.WriteAction.run(WriteAction.java:84)
	at com.intellij.testFramework.LightProjectDescriptor.setUpProject(LightProjectDescriptor.java:43)
	at com.mongodb.jbplugin.dialects.springquery.MongoDbProjectDescriptor.setUpProject(IntegrationTest.kt:276)
	at com.intellij.testFramework.LightPlatformTestCase.initProject(LightPlatformTestCase.java:182)
	... 57 more
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiFile