File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui
utbot-ui-commons/src/main/kotlin/org/utbot/intellij/plugin/settings Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -860,6 +860,18 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
860
860
861
861
val settings = model.project.service<Settings >()
862
862
863
+ when (model.projectType) {
864
+ ProjectType .Spring -> {
865
+ if (! settings.isSpringHandled) {
866
+ settings.isSpringHandled = true
867
+ settings.fuzzingValue =
868
+ if (settings.fuzzingValue == 0.0 ) 0.0
869
+ else settings.fuzzingValue.coerceAtLeast(0.3 )
870
+ }
871
+ }
872
+ else -> {}
873
+ }
874
+
863
875
mockStrategies.item = when (model.projectType) {
864
876
ProjectType .Spring -> MockStrategyApi .springDefaultItem
865
877
else -> settings.mockStrategy
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ class Settings(val project: Project) : PersistentStateComponent<Settings.State>
70
70
var summariesGenerationType : SummariesGenerationType = UtSettings .summaryGenerationType,
71
71
var generationTimeoutInMillis : Long = UtSettings .utBotGenerationTimeoutInMillis,
72
72
var enableExperimentalLanguagesSupport : Boolean = false ,
73
+ var isSpringHandled : Boolean = false ,
73
74
) {
74
75
75
76
override fun equals (other : Any? ): Boolean {
@@ -178,6 +179,16 @@ class Settings(val project: Project) : PersistentStateComponent<Settings.State>
178
179
179
180
var enableSummariesGeneration = state.summariesGenerationType
180
181
182
+ /* *
183
+ * Defaults in Spring are slightly different, so for every Spring project we update settings, but only
184
+ * do it once so user is not stuck with defaults, hence this flag is needed to avoid repeated updates.
185
+ */
186
+ var isSpringHandled: Boolean
187
+ get() = state.isSpringHandled
188
+ set(value) {
189
+ state.isSpringHandled = value
190
+ }
191
+
181
192
fun setClassesToMockAlways (classesToMockAlways : List <String >) {
182
193
state.classesToMockAlways = classesToMockAlways.distinct().toTypedArray()
183
194
}
You can’t perform that action at this time.
0 commit comments