@@ -78,7 +78,7 @@ import org.jetbrains.concurrency.Promise
78
78
import org.jetbrains.concurrency.thenRun
79
79
import org.utbot.common.PathUtil.toPath
80
80
import org.utbot.framework.UtSettings
81
- import org.utbot.framework.codegen.domain.DependencyInjectionFramework
81
+ import org.utbot.framework.codegen.domain.SpringModule
82
82
import org.utbot.framework.codegen.domain.ForceStaticMocking
83
83
import org.utbot.framework.codegen.domain.Junit4
84
84
import org.utbot.framework.codegen.domain.Junit5
@@ -361,18 +361,18 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
361
361
}
362
362
363
363
364
- DependencyInjectionFramework .allItems.forEach {
364
+ SpringModule .allItems.forEach {
365
365
it.isInstalled = findDependencyInjectionLibrary(model.srcModule, it) != null
366
366
}
367
- DependencyInjectionFramework .installedItems.forEach {
367
+ SpringModule .installedItems.forEach {
368
368
it.testFrameworkInstalled = findDependencyInjectionTestLibrary(model.testModule, it) != null
369
369
}
370
370
371
371
val isUtBotSpringRuntimePresent = this ::class .java.classLoader.getResource(" lib/utbot-spring-analyzer-shadow.jar" ) != null
372
372
373
373
model.projectType =
374
374
// TODO show some warning, when we see Spring project, but don't have `utBotSpringRuntime`
375
- if (isUtBotSpringRuntimePresent && DependencyInjectionFramework .installedItems.isNotEmpty()) ProjectType .Spring
375
+ if (isUtBotSpringRuntimePresent && SpringModule .installedItems.isNotEmpty()) ProjectType .Spring
376
376
else ProjectType .PureJvm
377
377
378
378
// Configure notification urls callbacks
@@ -963,7 +963,7 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
963
963
private fun configureSpringTestFrameworkIfRequired () {
964
964
if (springConfig.item != NO_SPRING_CONFIGURATION_OPTION ) {
965
965
966
- DependencyInjectionFramework .installedItems
966
+ SpringModule .installedItems
967
967
.filter { it.isInstalled }
968
968
.forEach { configureSpringTestDependency(it) }
969
969
}
@@ -992,11 +992,11 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
992
992
.onError { selectedTestFramework.isInstalled = false }
993
993
}
994
994
995
- private fun configureSpringTestDependency (framework : DependencyInjectionFramework ) {
995
+ private fun configureSpringTestDependency (springModule : SpringModule ) {
996
996
val frameworkLibrary =
997
- findDependencyInjectionLibrary(model.srcModule, framework , LibrarySearchScope .Project )
997
+ findDependencyInjectionLibrary(model.srcModule, springModule , LibrarySearchScope .Project )
998
998
val frameworkTestLibrary =
999
- findDependencyInjectionTestLibrary(model.testModule, framework , LibrarySearchScope .Project )
999
+ findDependencyInjectionTestLibrary(model.testModule, springModule , LibrarySearchScope .Project )
1000
1000
1001
1001
val frameworkVersionInProject = frameworkLibrary?.libraryName?.parseVersion()
1002
1002
? : error(" Trying to install Spring test framework, but Spring framework is not found in module ${model.srcModule.name} " )
@@ -1005,16 +1005,16 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
1005
1005
if (frameworkTestVersionInProject == null ||
1006
1006
! frameworkTestVersionInProject.isCompatibleWith(frameworkVersionInProject)
1007
1007
) {
1008
- val libraryDescriptor = when (framework ) {
1008
+ val libraryDescriptor = when (springModule ) {
1009
1009
SpringBoot -> springBootTestLibraryDescriptor(frameworkVersionInProject)
1010
1010
SpringBeans -> springTestLibraryDescriptor(frameworkVersionInProject)
1011
- else -> error(" Unsupported DI framework type $framework " )
1011
+ else -> error(" Unsupported DI framework type $springModule " )
1012
1012
}
1013
1013
1014
1014
model.preClasspathCollectionPromises + = addDependency(model.testModule, libraryDescriptor)
1015
1015
}
1016
1016
1017
- framework .testFrameworkInstalled = true
1017
+ springModule .testFrameworkInstalled = true
1018
1018
}
1019
1019
1020
1020
private fun configureMockFramework () {
@@ -1308,7 +1308,7 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
1308
1308
) {
1309
1309
this .append(value.displayName, SimpleTextAttributes .REGULAR_ATTRIBUTES )
1310
1310
if (springConfig.item != NO_SPRING_CONFIGURATION_OPTION ) {
1311
- DependencyInjectionFramework .installedItems
1311
+ SpringModule .installedItems
1312
1312
// only first missing test framework is shown to avoid overflowing ComboBox
1313
1313
.firstOrNull { ! it.testFrameworkInstalled }
1314
1314
?.let { diFramework ->
0 commit comments