diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt index 8076c2208a..e0cc22c797 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt @@ -520,7 +520,7 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m text = run { val sdkVersion = findSdkVersionOrNull(this@GenerateTestsDialogWindow.model.srcModule)?.feature if (sdkVersion != null) { - "SDK version $sdkVersion is not supported, use ${JavaSdkVersion.JDK_1_8}, ${JavaSdkVersion.JDK_11} or ${JavaSdkVersion.JDK_17}" + "SDK version $sdkVersion is not supported, use ${JavaSdkVersion.JDK_1_8.toReadableString()}, ${JavaSdkVersion.JDK_11.toReadableString()} or ${JavaSdkVersion.JDK_17.toReadableString()} instead." } else { "SDK is not defined" } @@ -533,6 +533,8 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m }) } + fun JavaSdkVersion.toReadableString() : String = toString().replace("JDK_", "").replace('_', '.') + override fun getBackground(): Color? = EditorColorsManager.getInstance().globalScheme.getColor(HintUtil.ERROR_COLOR_KEY) ?: super.getBackground() diff --git a/utbot-intellij/src/test/kotlin/org/utbot/tests/UnitTestBotActionTest.kt b/utbot-intellij/src/test/kotlin/org/utbot/tests/UnitTestBotActionTest.kt index 3d5f7acb87..e06b403bc8 100644 --- a/utbot-intellij/src/test/kotlin/org/utbot/tests/UnitTestBotActionTest.kt +++ b/utbot-intellij/src/test/kotlin/org/utbot/tests/UnitTestBotActionTest.kt @@ -68,7 +68,7 @@ class UnitTestBotActionTest : BaseTest() { textEditor().typeAdditionFunction(newClassName) openUTBotDialogFromProjectViewForClass(newClassName) assertThat(unitTestBotDialog.generateTestsButton.isEnabled().not()) - assertThat(unitTestBotDialog.sdkNotificationLabel.hasText("SDK version 19 is not supported, use JDK_1_8, JDK_11 or JDK_17")) + assertThat(unitTestBotDialog.sdkNotificationLabel.hasText("SDK version 19 is not supported, use 1.8, 11 or 17 instead.")) assertThat(unitTestBotDialog.setupSdkLink.isShowing) unitTestBotDialog.closeButton.click() }