diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/Notifications.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/Notifications.kt index 0c916c0239..7b9a3d6705 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/Notifications.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/Notifications.kt @@ -83,13 +83,8 @@ abstract class UrlNotifier : Notifier() { protected abstract val urlOpeningListener: NotificationListener override fun notify(info: String, project: Project?, module: Module?) { - notificationGroup - .createNotification( - titleText, - content(project, module, info), - notificationType, - urlOpeningListener, - ).notify(project) + notificationGroup.createNotification(content(project, module, info), notificationType) + .setTitle(titleText).setListener(urlOpeningListener).notify(project) } } diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/utils/ModuleUtils.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/utils/ModuleUtils.kt index 897746ede1..20a226adcb 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/utils/ModuleUtils.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/utils/ModuleUtils.kt @@ -13,6 +13,7 @@ import com.intellij.openapi.module.Module import com.intellij.openapi.module.ModuleManager import com.intellij.openapi.module.ModuleUtilCore import com.intellij.openapi.project.Project +import com.intellij.openapi.project.guessModuleDir import com.intellij.openapi.projectRoots.JavaSdk import com.intellij.openapi.projectRoots.JavaSdkVersion import com.intellij.openapi.projectRoots.Sdk @@ -165,8 +166,8 @@ fun Module.addDedicatedTestRoot(testSourceRoots: MutableList): Virt val moduleInstance = ModuleRootManager.getInstance(this) val testFolder = moduleInstance.contentEntries.flatMap { it.sourceFolders.toList() } .firstOrNull { it.rootType in testSourceRootTypes } - (testFolder?.let { testFolder.file?.parent } ?: (testFolder?.contentEntry - ?: moduleInstance.contentEntries.first()).file ?: moduleFile)?.let { + (testFolder?.let { testFolder.file?.parent } + ?: testFolder?.contentEntry?.file ?: this.guessModuleDir())?.let { val file = FakeVirtualFile(it, dedicatedTestSourceRootName) testSourceRoots.add(file) // We return "true" IFF it's case of not yet created fake directory