File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -737,12 +737,12 @@ enum class ProjectType {
737
737
JavaScript ,
738
738
}
739
739
740
- enum class TypeReplacementApproach {
740
+ sealed class TypeReplacementApproach {
741
741
/* *
742
742
* Do not replace interfaces and abstract classes with concrete implementors.
743
743
* Use mocking instead of it.
744
744
*/
745
- DO_NOT_REPLACE ,
745
+ object DoNotReplace : TypeReplacementApproach()
746
746
747
747
/* *
748
748
* Try to replace interfaces and abstract classes with concrete implementors
@@ -751,7 +751,7 @@ enum class TypeReplacementApproach {
751
751
*
752
752
* Currently used in Spring applications only.
753
753
*/
754
- REPLACE_IF_POSSIBLE ,
754
+ class ReplaceIfPossible ( val configFqn : String ) : TypeReplacementApproach()
755
755
}
756
756
757
757
abstract class DependencyInjectionFramework (
Original file line number Diff line number Diff line change @@ -180,8 +180,8 @@ object UtTestsDialogProcessor {
180
180
val applicationContext = when (model.projectType) {
181
181
Spring -> {
182
182
val shouldUseImplementors = when (model.typeReplacementApproach) {
183
- TypeReplacementApproach .DO_NOT_REPLACE -> false
184
- TypeReplacementApproach .REPLACE_IF_POSSIBLE -> true
183
+ TypeReplacementApproach .DoNotReplace -> false
184
+ is TypeReplacementApproach .ReplaceIfPossible -> true
185
185
}
186
186
187
187
SpringApplicationContext (
Original file line number Diff line number Diff line change @@ -546,8 +546,8 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
546
546
547
547
model.typeReplacementApproach =
548
548
when (springConfig.item) {
549
- NO_SPRING_CONFIGURATION_OPTION -> TypeReplacementApproach .DO_NOT_REPLACE
550
- else -> TypeReplacementApproach .REPLACE_IF_POSSIBLE
549
+ NO_SPRING_CONFIGURATION_OPTION -> TypeReplacementApproach .DoNotReplace
550
+ else -> TypeReplacementApproach .ReplaceIfPossible (springConfig.item)
551
551
}
552
552
553
553
val settings = model.project.service<Settings >()
You can’t perform that action at this time.
0 commit comments