File tree 1 file changed +16
-3
lines changed
utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api
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())
1156
1156
*/
1157
1157
open class StandardApplicationContext (
1158
1158
val mockFrameworkInstalled : Boolean = true ,
1159
- val staticsMockingIsConfigured : Boolean = true ,
1159
+ staticsMockingIsConfigured : Boolean = true ,
1160
1160
) {
1161
+ var staticsMockingIsConfigured = staticsMockingIsConfigured
1162
+ private set
1163
+
1161
1164
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
1164
1177
}
1165
1178
}
1166
1179
}
You can’t perform that action at this time.
0 commit comments