From f0957a2f5ab53b51e4bd2be82c76c6cc3c8de933 Mon Sep 17 00:00:00 2001 From: "Vassiliy.Kudryashov" Date: Fri, 16 Sep 2022 23:21:01 +0300 Subject: [PATCH 1/4] Settings cannot be loaded because of NullPointerException #951 --- .../org/utbot/framework/plugin/api/Api.kt | 25 +++++++++----- .../org/utbot/framework/codegen/Domain.kt | 30 ++++++++++++----- .../plugin/settings/SettingsWindow.kt | 8 +++-- .../plugin/ui/GenerateTestsDialogWindow.kt | 33 +++++++++++-------- .../CodeGenerationSettingItemRenderer.kt | 22 +++++++++++++ 5 files changed, 86 insertions(+), 32 deletions(-) create mode 100644 utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/components/CodeGenerationSettingItemRenderer.kt diff --git a/utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt b/utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt index 11c0cf26cb..c6cabfc70a 100644 --- a/utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt +++ b/utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt @@ -1045,6 +1045,7 @@ open class TypeParameters(val parameters: List = emptyList()) class WildcardTypeParameter : TypeParameters(emptyList()) interface CodeGenerationSettingItem { + val id : String val displayName: String val description: String } @@ -1057,20 +1058,23 @@ interface CodeGenerationSettingBox { } enum class MockStrategyApi( + override val id : String, override val displayName: String, override val description: String ) : CodeGenerationSettingItem { - NO_MOCKS("Do not mock", "Do not use mock frameworks at all"), + NO_MOCKS("No mocks", "Do not mock", "Do not use mock frameworks at all"), OTHER_PACKAGES( + "Other packages: Mockito", "Mock package environment", "Mock all classes outside the current package except system ones" ), OTHER_CLASSES( + "Other classes: Mockito", "Mock class environment", "Mock all classes outside the class under test except system ones" ); - override fun toString() = displayName + override fun toString() = id // Get is mandatory because of the initialization order of the inheritors. // Otherwise, in some cases we could get an incorrect value @@ -1081,20 +1085,23 @@ enum class MockStrategyApi( } enum class TreatOverflowAsError( + override val id : String, override val displayName: String, override val description: String, ) : CodeGenerationSettingItem { AS_ERROR( + id = "Treat overflows as errors", displayName = "Treat overflows as errors", description = "Generate tests that treat possible overflows in arithmetic operations as errors " + "that throw Arithmetic Exception", ), IGNORE( + id = "Ignore overflows", displayName = "Ignore overflows", description = "Ignore possible overflows in arithmetic operations", ); - override fun toString(): String = displayName + override fun toString(): String = id // Get is mandatory because of the initialization order of the inheritors. // Otherwise, in some cases we could get an incorrect value @@ -1105,13 +1112,14 @@ enum class TreatOverflowAsError( } enum class MockFramework( + override val id: String = "Mockito", override val displayName: String, override val description: String = "Use $displayName as mock framework", var isInstalled: Boolean = false ) : CodeGenerationSettingItem { - MOCKITO("Mockito"); + MOCKITO(displayName = "Mockito"); - override fun toString() = displayName + override fun toString() = id companion object : CodeGenerationSettingBox { override val defaultItem: MockFramework = MOCKITO @@ -1120,11 +1128,12 @@ enum class MockFramework( } enum class CodegenLanguage( + override val id: String, override val displayName: String, @Suppress("unused") override val description: String = "Generate unit tests in $displayName" ) : CodeGenerationSettingItem { - JAVA(displayName = "Java"), - KOTLIN(displayName = "Kotlin (experimental)"); + JAVA(id = "Java", displayName = "Java"), + KOTLIN(id = "Kotlin", displayName = "Kotlin (experimental)"); enum class OperatingSystem { WINDOWS, @@ -1163,7 +1172,7 @@ enum class CodegenLanguage( KOTLIN -> listOf(System.getenv("JAVA_HOME"), "bin", "java") }.joinToString(File.separator) - override fun toString(): String = displayName + override fun toString(): String = id fun getCompilationCommand(buildDirectory: String, classPath: String, sourcesFiles: List): List { val arguments = when (this) { diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/Domain.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/Domain.kt index 2bad966103..c9087c7462 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/Domain.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/Domain.kt @@ -103,10 +103,11 @@ fun testFrameworkByName(testFramework: String): TestFramework = */ sealed class StaticsMocking( var isConfigured: Boolean = false, + override val id: String, override val displayName: String, override val description: String = "Use static methods mocking" ) : CodeGenerationSettingItem { - override fun toString(): String = displayName + override fun toString(): String = id // Get is mandatory because of the initialization order of the inheritors. // Otherwise, in some cases we could get an incorrect value @@ -119,11 +120,12 @@ sealed class StaticsMocking( } object NoStaticMocking : StaticsMocking( + id = "No static mocking", displayName = "No static mocking", description = "Do not use additional settings to mock static fields" ) -object MockitoStaticMocking : StaticsMocking(displayName = "Mockito static mocking") { +object MockitoStaticMocking : StaticsMocking(id = "Mockito static mocking", displayName = "Mockito static mocking") { val mockedStaticClassId = BuiltinClassId( name = "org.mockito.MockedStatic", @@ -170,6 +172,7 @@ object MockitoStaticMocking : StaticsMocking(displayName = "Mockito static mocki } sealed class TestFramework( + override val id: String, override val displayName: String, override val description: String = "Use $displayName as test framework", ) : CodeGenerationSettingItem { @@ -235,7 +238,7 @@ sealed class TestFramework( additionalArguments: List ): List - override fun toString() = displayName + override fun toString() = id // Get is mandatory because of the initialization order of the inheritors. // Otherwise, in some cases we could get an incorrect value, i.e. allItems = [null, JUnit5, TestNg] @@ -246,7 +249,7 @@ sealed class TestFramework( } } -object TestNg : TestFramework(displayName = "TestNG") { +object TestNg : TestFramework(id = "TestNG",displayName = "TestNG") { override val mainPackage: String = TEST_NG_PACKAGE override val testAnnotation: String = "@$mainPackage.Test" override val testAnnotationFqn: String = "$mainPackage.Test" @@ -375,7 +378,7 @@ object TestNg : TestFramework(displayName = "TestNG") { """.trimIndent() } -object Junit4 : TestFramework("JUnit4") { +object Junit4 : TestFramework(id = "JUnit4",displayName = "JUnit4") { private val parametrizedTestsNotSupportedError: Nothing get() = error("Parametrized tests are not supported for JUnit4") @@ -448,7 +451,7 @@ object Junit4 : TestFramework("JUnit4") { } } -object Junit5 : TestFramework("JUnit5") { +object Junit5 : TestFramework(id = "JUnit5", displayName = "JUnit5") { override val mainPackage: String = JUNIT5_PACKAGE override val testAnnotation = "@$mainPackage.Test" override val testAnnotationFqn: String = "$mainPackage.Test" @@ -589,20 +592,23 @@ object Junit5 : TestFramework("JUnit5") { } enum class RuntimeExceptionTestsBehaviour( + override val id: String, override val displayName: String, override val description: String ) : CodeGenerationSettingItem { PASS( + id = "Passing", displayName = "Pass", description = "Tests that produce Runtime exceptions should pass (by inserting throwable assertion)" ), FAIL( + id = "Failing", displayName = "Fail", description = "Tests that produce Runtime exceptions should fail" + "(WARNING!: failing tests may appear in testing class)" ); - override fun toString(): String = displayName + override fun toString(): String = id // Get is mandatory because of the initialization order of the inheritors. // Otherwise, in some cases we could get an incorrect value @@ -623,11 +629,13 @@ data class HangingTestsTimeout(val timeoutMs: Long) { } enum class ForceStaticMocking( + override val id: String, override val displayName: String, override val description: String, val warningMessage: List, ) : CodeGenerationSettingItem { FORCE( + id = "Force static mocking", displayName = "Force static mocking", description = "Use mocks for static methods and constructors invocations even if static mocking is disabled" + "(WARNING!: can add imports from missing dependencies)", @@ -638,6 +646,7 @@ enum class ForceStaticMocking( ) ), DO_NOT_FORCE( + id = "Do not force static mocking", displayName = "Do not force static mocking", description = "Do not force static mocking if static mocking setting is disabled" + "(WARNING!: flaky tests can appear)", @@ -647,7 +656,7 @@ enum class ForceStaticMocking( ) ); - override fun toString(): String = displayName + override fun toString(): String = id // Get is mandatory because of the initialization order of the inheritors. // Otherwise, in some cases we could get an incorrect value @@ -658,19 +667,22 @@ enum class ForceStaticMocking( } enum class ParametrizedTestSource( + override val id: String, override val displayName: String, override val description: String = "Use $displayName for parametrized tests" ) : CodeGenerationSettingItem { DO_NOT_PARAMETRIZE( + id = "Not parametrized", displayName = "Not parametrized", description = "Do not generate parametrized tests" ), PARAMETRIZE( + id = "Parametrized", displayName = "Parametrized", description = "Generate parametrized tests" ); - override fun toString(): String = displayName + override fun toString(): String = id // Get is mandatory because of the initialization order of the inheritors. // Otherwise, in some cases we could get an incorrect value diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/settings/SettingsWindow.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/settings/SettingsWindow.kt index fd0e7ab992..34a4d6dfa1 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/settings/SettingsWindow.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/settings/SettingsWindow.kt @@ -24,6 +24,7 @@ import org.utbot.framework.codegen.RuntimeExceptionTestsBehaviour import org.utbot.framework.plugin.api.CodeGenerationSettingItem import org.utbot.framework.plugin.api.CodegenLanguage import org.utbot.framework.plugin.api.TreatOverflowAsError +import org.utbot.intellij.plugin.ui.components.CodeGenerationSettingItemRenderer class SettingsWindow(val project: Project) { private val settings = project.service() @@ -36,7 +37,7 @@ class SettingsWindow(val project: Project) { val valuesComboBox: LayoutBuilder.(KClass<*>, Array<*>) -> Unit = { loader, values -> val serviceLabels = mapOf( CodegenLanguage::class to "Generated test language:", - RuntimeExceptionTestsBehaviour::class to "Test with exceptions:", + RuntimeExceptionTestsBehaviour::class to "Tests with exceptions:", TreatOverflowAsError::class to "Overflow detection:", ) val tooltipLabels = mapOf( @@ -49,7 +50,10 @@ class SettingsWindow(val project: Project) { DefaultComboBoxModel(values), getter = { settings.providerNameByServiceLoader(loader) }, setter = { settings.setProviderByLoader(loader, it as CodeGenerationSettingItem) }, - ).apply { ContextHelpLabel.create(tooltipLabels[loader] ?: return@apply)() } + ).apply { + component.renderer = CodeGenerationSettingItemRenderer() + ContextHelpLabel.create(tooltipLabels[loader] ?: return@apply)() + } } } } 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 8681327a71..90115c4b20 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 @@ -124,6 +124,7 @@ import org.utbot.intellij.plugin.models.mockitoCoreLibraryDescriptor import org.utbot.intellij.plugin.models.packageName import org.utbot.intellij.plugin.models.testNgLibraryDescriptor import org.utbot.intellij.plugin.settings.Settings +import org.utbot.intellij.plugin.ui.components.CodeGenerationSettingItemRenderer import org.utbot.intellij.plugin.ui.components.TestFolderComboWithBrowseButton import org.utbot.intellij.plugin.ui.utils.LibrarySearchScope import org.utbot.intellij.plugin.ui.utils.addSourceRootIfAbsent @@ -168,9 +169,9 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m private val testSourceFolderField = TestFolderComboWithBrowseButton(model) - private val codegenLanguages = ComboBox(DefaultComboBoxModel(CodegenLanguage.values())) - private val testFrameworks = ComboBox(DefaultComboBoxModel(TestFramework.allItems.toTypedArray())) - private val mockStrategies = ComboBox(DefaultComboBoxModel(MockStrategyApi.values())) + private val codegenLanguages = createComboBox(CodegenLanguage.values()) + private val testFrameworks = createComboBox(TestFramework.allItems.toTypedArray()) + private val mockStrategies = createComboBox(MockStrategyApi.values()) private val staticsMocking = JCheckBox("Mock static methods") private val timeoutSpinner = JBIntSpinner( @@ -191,6 +192,12 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m parametrizedTestSources to null ) + private fun createComboBox(values: Array) : ComboBox { + return ComboBox(DefaultComboBoxModel(values)).also { + it.renderer = CodeGenerationSettingItemRenderer() + } + } + private fun createHelpLabel(commonTooltip: String? = null) = JBLabel(AllIcons.General.ContextHelp).apply { if (!commonTooltip.isNullOrEmpty()) toolTipText = commonTooltip } @@ -239,22 +246,22 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m row("Test source root:") { component(testSourceFolderField) } - row("Code generation language:") { - makePanelWithHelpTooltip( - codegenLanguages as ComboBox, - itemsToHelpTooltip[codegenLanguages] - ) - }.visible = false +// row("Code generation language:") { +// makePanelWithHelpTooltip( +// codegenLanguages, +// itemsToHelpTooltip[codegenLanguages] +// ) +// } row("Testing framework:") { makePanelWithHelpTooltip( - testFrameworks as ComboBox, + testFrameworks, null ) } row { component(parametrizedTestSources) } row("Mock strategy:") { makePanelWithHelpTooltip( - mockStrategies as ComboBox, + mockStrategies, ContextHelpLabel.create("Mock everything around the target class or the whole package except the system classes. Otherwise mock nothing.") ) } @@ -959,7 +966,7 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m list: JList, value: TestFramework?, index: Int, selected: Boolean, hasFocus: Boolean ) { - this.append(value.toString(), SimpleTextAttributes.REGULAR_ATTRIBUTES) + this.append(value?.displayName?:"", SimpleTextAttributes.REGULAR_ATTRIBUTES) if (value == null || !value.isInstalled) { this.append(WILL_BE_INSTALLED_LABEL, SimpleTextAttributes.ERROR_ATTRIBUTES) } @@ -984,7 +991,7 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m list: JList, value: MockStrategyApi?, index: Int, selected: Boolean, hasFocus: Boolean ) { - this.append(value.toString(), SimpleTextAttributes.REGULAR_ATTRIBUTES) + this.append(value?.displayName?:"", SimpleTextAttributes.REGULAR_ATTRIBUTES) if (value != MockStrategyApi.NO_MOCKS && !MOCKITO.isInstalled) { this.append(WILL_BE_INSTALLED_LABEL, SimpleTextAttributes.ERROR_ATTRIBUTES) } diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/components/CodeGenerationSettingItemRenderer.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/components/CodeGenerationSettingItemRenderer.kt new file mode 100644 index 0000000000..2ee1d63b54 --- /dev/null +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/components/CodeGenerationSettingItemRenderer.kt @@ -0,0 +1,22 @@ +package org.utbot.intellij.plugin.ui.components + +import java.awt.Component +import javax.swing.DefaultListCellRenderer +import javax.swing.JList +import org.utbot.framework.plugin.api.CodeGenerationSettingItem + +open class CodeGenerationSettingItemRenderer : DefaultListCellRenderer() { + override fun getListCellRendererComponent( + list: JList<*>?, + value: Any?, + index: Int, + isSelected: Boolean, + cellHasFocus: Boolean + ): Component { + return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus).apply { + if (value is CodeGenerationSettingItem) { + text = value.displayName + } + } + } +} \ No newline at end of file From b4332ca456a2f8fdf1516af2774eef42b4fae01a Mon Sep 17 00:00:00 2001 From: "Vassiliy.Kudryashov" Date: Mon, 19 Sep 2022 14:53:32 +0300 Subject: [PATCH 2/4] Settings cannot be loaded because of NullPointerException #951 After-review improvements --- .../utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt | 8 ++------ .../ui/components/CodeGenerationSettingItemRenderer.kt | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) 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 90115c4b20..0636910dba 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 @@ -246,12 +246,6 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m row("Test source root:") { component(testSourceFolderField) } -// row("Code generation language:") { -// makePanelWithHelpTooltip( -// codegenLanguages, -// itemsToHelpTooltip[codegenLanguages] -// ) -// } row("Testing framework:") { makePanelWithHelpTooltip( testFrameworks, @@ -966,6 +960,7 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m list: JList, value: TestFramework?, index: Int, selected: Boolean, hasFocus: Boolean ) { + // Value cannot be null, but we need visual fallback for abnormal case this.append(value?.displayName?:"", SimpleTextAttributes.REGULAR_ATTRIBUTES) if (value == null || !value.isInstalled) { this.append(WILL_BE_INSTALLED_LABEL, SimpleTextAttributes.ERROR_ATTRIBUTES) @@ -991,6 +986,7 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m list: JList, value: MockStrategyApi?, index: Int, selected: Boolean, hasFocus: Boolean ) { + // Value cannot be null, but we need visual fallback for abnormal case this.append(value?.displayName?:"", SimpleTextAttributes.REGULAR_ATTRIBUTES) if (value != MockStrategyApi.NO_MOCKS && !MOCKITO.isInstalled) { this.append(WILL_BE_INSTALLED_LABEL, SimpleTextAttributes.ERROR_ATTRIBUTES) diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/components/CodeGenerationSettingItemRenderer.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/components/CodeGenerationSettingItemRenderer.kt index 2ee1d63b54..24b6b0a195 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/components/CodeGenerationSettingItemRenderer.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/components/CodeGenerationSettingItemRenderer.kt @@ -5,7 +5,7 @@ import javax.swing.DefaultListCellRenderer import javax.swing.JList import org.utbot.framework.plugin.api.CodeGenerationSettingItem -open class CodeGenerationSettingItemRenderer : DefaultListCellRenderer() { +internal class CodeGenerationSettingItemRenderer : DefaultListCellRenderer() { override fun getListCellRendererComponent( list: JList<*>?, value: Any?, From dc7c817bbf222f7c00fa5b59a879a9a1f49f35fd Mon Sep 17 00:00:00 2001 From: "Vassiliy.Kudryashov" Date: Mon, 19 Sep 2022 15:46:42 +0300 Subject: [PATCH 3/4] Settings cannot be loaded because of NullPointerException #951 After-review improvements 2 --- .../intellij/plugin/ui/GenerateTestsDialogWindow.kt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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 0636910dba..cfe32a6761 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 @@ -957,12 +957,11 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m testFrameworks.item = if (currentFrameworkItem in enabledTestFrameworks) currentFrameworkItem else defaultItem testFrameworks.renderer = object : ColoredListCellRenderer() { override fun customizeCellRenderer( - list: JList, value: TestFramework?, + list: JList, value: TestFramework, index: Int, selected: Boolean, hasFocus: Boolean ) { - // Value cannot be null, but we need visual fallback for abnormal case - this.append(value?.displayName?:"", SimpleTextAttributes.REGULAR_ATTRIBUTES) - if (value == null || !value.isInstalled) { + this.append(value.displayName, SimpleTextAttributes.REGULAR_ATTRIBUTES) + if (!value.isInstalled) { this.append(WILL_BE_INSTALLED_LABEL, SimpleTextAttributes.ERROR_ATTRIBUTES) } } @@ -983,11 +982,10 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m private fun updateMockStrategyList() { mockStrategies.renderer = object : ColoredListCellRenderer() { override fun customizeCellRenderer( - list: JList, value: MockStrategyApi?, + list: JList, value: MockStrategyApi, index: Int, selected: Boolean, hasFocus: Boolean ) { - // Value cannot be null, but we need visual fallback for abnormal case - this.append(value?.displayName?:"", SimpleTextAttributes.REGULAR_ATTRIBUTES) + this.append(value.displayName, SimpleTextAttributes.REGULAR_ATTRIBUTES) if (value != MockStrategyApi.NO_MOCKS && !MOCKITO.isInstalled) { this.append(WILL_BE_INSTALLED_LABEL, SimpleTextAttributes.ERROR_ATTRIBUTES) } From 5c82ccb7605cee0165477d1e66f9174cb794db1a Mon Sep 17 00:00:00 2001 From: "Vassiliy.Kudryashov" Date: Mon, 19 Sep 2022 16:14:17 +0300 Subject: [PATCH 4/4] Settings cannot be loaded because of NullPointerException #951 After-review improvements 3 --- .../org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 cfe32a6761..49c0e6663f 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 @@ -192,7 +192,7 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m parametrizedTestSources to null ) - private fun createComboBox(values: Array) : ComboBox { + private fun createComboBox(values: Array) : ComboBox { return ComboBox(DefaultComboBoxModel(values)).also { it.renderer = CodeGenerationSettingItemRenderer() }