@@ -109,7 +109,7 @@ import org.utbot.framework.codegen.StaticsMocking
109
109
import org.utbot.framework.codegen.TestFramework
110
110
import org.utbot.framework.codegen.TestNg
111
111
import org.utbot.framework.codegen.model.util.MOCKITO_EXTENSIONS_FILE_CONTENT
112
- import org.utbot.framework.codegen.model.util.MOCKITO_EXTENSIONS_STORAGE
112
+ import org.utbot.framework.codegen.model.util.MOCKITO_EXTENSIONS_FOLDER
113
113
import org.utbot.framework.codegen.model.util.MOCKITO_MOCKMAKER_FILE_NAME
114
114
import org.utbot.framework.plugin.api.CodeGenerationSettingItem
115
115
import org.utbot.framework.plugin.api.CodegenLanguage
@@ -762,15 +762,15 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
762
762
* for further details.
763
763
*/
764
764
private fun configureMockitoResources (testResourcesPath : Path ) {
765
- val mockitoExtensionsPath = " $testResourcesPath /$MOCKITO_EXTENSIONS_STORAGE " .toPath()
765
+ val mockitoExtensionsPath = " $testResourcesPath /$MOCKITO_EXTENSIONS_FOLDER " .toPath()
766
766
val mockitoMockMakerPath = " $mockitoExtensionsPath /$MOCKITO_MOCKMAKER_FILE_NAME " .toPath()
767
767
768
768
if (! testResourcesPath.exists()) Files .createDirectory(testResourcesPath)
769
769
if (! mockitoExtensionsPath.exists()) Files .createDirectory(mockitoExtensionsPath)
770
770
771
771
if (! mockitoMockMakerPath.exists()) {
772
772
Files .createFile(mockitoMockMakerPath)
773
- Files .write(mockitoMockMakerPath, MOCKITO_EXTENSIONS_FILE_CONTENT )
773
+ Files .write(mockitoMockMakerPath, listOf ( MOCKITO_EXTENSIONS_FILE_CONTENT ) )
774
774
}
775
775
}
776
776
@@ -1027,14 +1027,15 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
1027
1027
.map { f -> Paths .get(urlToPath(f.url)) }
1028
1028
}
1029
1029
1030
- return entriesPaths.all { path ->
1031
- if (Files .exists(path)) {
1032
- val fileNames = Files .walk(path).map { it.fileName }.toList()
1033
- fileNames.any { it.toString() == MOCKITO_MOCKMAKER_FILE_NAME }
1034
- } else {
1035
- false
1030
+ return entriesPaths.all { entryPath ->
1031
+ if (! Files .exists(entryPath)) return false
1032
+
1033
+ val mockMakerPath = " $entryPath /$MOCKITO_EXTENSIONS_FOLDER /$MOCKITO_MOCKMAKER_FILE_NAME " .toPath()
1034
+ if (! Files .exists(mockMakerPath)) return false
1035
+
1036
+ val fileLines = Files .readAllLines(mockMakerPath)
1037
+ fileLines.singleOrNull() == MOCKITO_EXTENSIONS_FILE_CONTENT
1036
1038
}
1037
- }
1038
1039
}
1039
1040
}
1040
1041
0 commit comments