File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -1156,11 +1156,24 @@ class WildcardTypeParameter : TypeParameters(emptyList())
11561156 */
11571157open class StandardApplicationContext (
11581158 val mockFrameworkInstalled : Boolean = true ,
1159- val staticsMockingIsConfigured : Boolean = true ,
1159+ staticsMockingIsConfigured : Boolean = true ,
11601160) {
1161+ var staticsMockingIsConfigured = staticsMockingIsConfigured
1162+ private set
1163+
11611164 init {
1162- if (! mockFrameworkInstalled) {
1163- require(! staticsMockingIsConfigured) { " Static mocking cannot be used without mock framework" }
1165+ /* *
1166+ * Situation when mock framework is not installed but static mocking is configured is semantically incorrect.
1167+ *
1168+ * However, it may be obtained in real application after this actions:
1169+ * - fully configure mocking (dependency installed + resource file created)
1170+ * - remove mockito-core dependency from project
1171+ * - forget to remove mock-maker file from resource directory
1172+ *
1173+ * Here we transform this configuration to semantically correct.
1174+ */
1175+ if (! mockFrameworkInstalled && staticsMockingIsConfigured) {
1176+ this .staticsMockingIsConfigured = false
11641177 }
11651178 }
11661179}
You can’t perform that action at this time.
0 commit comments