You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: utbot-framework/src/main/kotlin/org/utbot/engine/Mocks.kt
+34-8Lines changed: 34 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -188,12 +188,28 @@ class Mocker(
188
188
if (isOverriddenClass(type)) returnfalse// never mock overriden classes
189
189
if (type.isInaccessibleViaReflection) returnfalse// never mock classes that we can't process with reflection
190
190
if (isMakeSymbolic(mockInfo)) returntrue// support for makeSymbolic
191
-
if (type.sootClass.isArtificialEntity) returnfalse// never mock artificial types, i.e. Maps$lambda_computeValue_1__7
192
-
if (!isEngineClass(type) && (type.sootClass.isInnerClass || type.sootClass.isLocal || type.sootClass.isAnonymous)) returnfalse// there is no reason (and maybe no possibility) to mock such classes
193
-
if (!isEngineClass(type) && type.sootClass.isPrivate) returnfalse// could not mock private classes (even if it is in mock always list)
191
+
192
+
val sootClass = type.sootClass
193
+
194
+
if (sootClass.isArtificialEntity) returnfalse// never mock artificial types, i.e. Maps$lambda_computeValue_1__7
195
+
196
+
if (!isEngineClass(type)) {
197
+
// there is no reason (and maybe no possibility) to mock such classes
198
+
if (sootClass.isInnerClass || sootClass.isLocal || sootClass.isAnonymous) {
199
+
returnfalse
200
+
}
201
+
202
+
// could not mock private classes (even if it is in mock always list)
203
+
if (sootClass.isPrivate) {
204
+
returnfalse
205
+
}
206
+
}
207
+
194
208
if (mockAlways(type)) returntrue// always mock randoms and loggers
209
+
195
210
if (mockInfo isUtFieldMockInfo) {
196
-
val declaringClass = mockInfo.fieldId.declaringClass
211
+
val fieldId = mockInfo.fieldId
212
+
val declaringClass = fieldId.declaringClass
197
213
val sootDeclaringClass =Scene.v().getSootClass(declaringClass.name)
198
214
199
215
if (sootDeclaringClass.isArtificialEntity || sootDeclaringClass.isOverridden) {
0 commit comments