@@ -10,7 +10,6 @@ import org.utbot.framework.plugin.api.UtCompositeModel
1010import org.utbot.framework.plugin.api.UtDirectSetFieldModel
1111import org.utbot.framework.plugin.api.UtEnumConstantModel
1212import org.utbot.framework.plugin.api.UtExecutableCallModel
13- import org.utbot.framework.plugin.api.UtExecutionSuccess
1413import org.utbot.framework.plugin.api.UtLambdaModel
1514import org.utbot.framework.plugin.api.UtModel
1615import org.utbot.framework.plugin.api.UtNullModel
@@ -37,35 +36,21 @@ class SpringTestClassModelBuilder: TestClassModelBuilder() {
3736 testSets : List <CgMethodTestSet >,
3837 ): Pair <Map <ClassId , Set <UtModel >>, Map<ClassId, Set<UtModel>>> {
3938 val thisInstances = mutableSetOf<UtModel >()
40- val allModelsInExecution = mutableListOf <UtModel >()
39+ val thisInstancesDependentModels = mutableSetOf <UtModel >()
4140
4241 for (testSet in testSets) {
4342 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 }
5845 }
5946 }
6047
61- val allConstructedModels = mutableSetOf<UtModel >()
62- allModelsInExecution.forEach { model -> collectRecursively(model, allConstructedModels) }
48+ thisInstances.forEach { model -> collectRecursively(model, thisInstancesDependentModels) }
6349
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 }
6752
68- return thisInstances.groupByClassId() to mockedModels .groupByClassId()
53+ return thisInstances.groupByClassId() to dependentMockModels .groupByClassId()
6954 }
7055
7156 private fun Set<UtModel>.groupByClassId (): Map <ClassId , Set <UtModel >> {
0 commit comments