@@ -10,7 +10,6 @@ import org.utbot.framework.plugin.api.UtCompositeModel
10
10
import org.utbot.framework.plugin.api.UtDirectSetFieldModel
11
11
import org.utbot.framework.plugin.api.UtEnumConstantModel
12
12
import org.utbot.framework.plugin.api.UtExecutableCallModel
13
- import org.utbot.framework.plugin.api.UtExecutionSuccess
14
13
import org.utbot.framework.plugin.api.UtLambdaModel
15
14
import org.utbot.framework.plugin.api.UtModel
16
15
import org.utbot.framework.plugin.api.UtNullModel
@@ -37,35 +36,21 @@ class SpringTestClassModelBuilder: TestClassModelBuilder() {
37
36
testSets : List <CgMethodTestSet >,
38
37
): Pair <Map <ClassId , Set <UtModel >>, Map<ClassId, Set<UtModel>>> {
39
38
val thisInstances = mutableSetOf<UtModel >()
40
- val allModelsInExecution = mutableListOf <UtModel >()
39
+ val thisInstancesDependentModels = mutableSetOf <UtModel >()
41
40
42
41
for (testSet in testSets) {
43
42
for (execution in testSet.executions) {
44
- execution.stateBefore.thisInstance?.let {
45
- allModelsInExecution + = it
46
- thisInstances + = it
47
- }
48
-
49
- execution.stateAfter.thisInstance?.let {
50
- allModelsInExecution + = it
51
- thisInstances + = it
52
- }
53
-
54
- allModelsInExecution + = execution.stateBefore.parameters
55
- allModelsInExecution + = execution.stateAfter.parameters
56
-
57
- (execution.result as ? UtExecutionSuccess )?.model?.let { allModelsInExecution + = it }
43
+ execution.stateBefore.thisInstance?.let { thisInstances + = it }
44
+ execution.stateAfter.thisInstance?.let { thisInstances + = it }
58
45
}
59
46
}
60
47
61
- val allConstructedModels = mutableSetOf<UtModel >()
62
- allModelsInExecution.forEach { model -> collectRecursively(model, allConstructedModels) }
48
+ thisInstances.forEach { model -> collectRecursively(model, thisInstancesDependentModels) }
63
49
64
- val mockedModels =
65
- allConstructedModels
66
- .filterTo(mutableSetOf ()) { it.isMockModel() && it !in thisInstances }
50
+ val dependentMockModels =
51
+ thisInstancesDependentModels.filterTo(mutableSetOf ()) { it.isMockModel() && it !in thisInstances }
67
52
68
- return thisInstances.groupByClassId() to mockedModels .groupByClassId()
53
+ return thisInstances.groupByClassId() to dependentMockModels .groupByClassId()
69
54
}
70
55
71
56
private fun Set<UtModel>.groupByClassId (): Map <ClassId , Set <UtModel >> {
0 commit comments