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 {
737737 JavaScript ,
738738}
739739
740- enum class TypeReplacementApproach {
740+ sealed class TypeReplacementApproach {
741741 /* *
742742 * Do not replace interfaces and abstract classes with concrete implementors.
743743 * Use mocking instead of it.
744744 */
745- DO_NOT_REPLACE ,
745+ object DoNotReplace : TypeReplacementApproach()
746746
747747 /* *
748748 * Try to replace interfaces and abstract classes with concrete implementors
@@ -751,7 +751,7 @@ enum class TypeReplacementApproach {
751751 *
752752 * Currently used in Spring applications only.
753753 */
754- REPLACE_IF_POSSIBLE ,
754+ class ReplaceIfPossible ( val configFqn : String ) : TypeReplacementApproach()
755755}
756756
757757abstract class DependencyInjectionFramework (
Original file line number Diff line number Diff line change @@ -180,8 +180,8 @@ object UtTestsDialogProcessor {
180180 val applicationContext = when (model.projectType) {
181181 Spring -> {
182182 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
185185 }
186186
187187 SpringApplicationContext (
Original file line number Diff line number Diff line change @@ -546,8 +546,8 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
546546
547547 model.typeReplacementApproach =
548548 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)
551551 }
552552
553553 val settings = model.project.service<Settings >()
You can’t perform that action at this time.
0 commit comments