Skip to content

Commit 48ad2d5

Browse files
committed
Make so persist() and detach() modifications are always applied for MANAGED and DETACHED entities
1 parent f25c231 commit 48ad2d5

File tree

1 file changed

+9
-13
lines changed
  • utbot-java-fuzzing/src/main/kotlin/org/utbot/fuzzing/spring/valid

1 file changed

+9
-13
lines changed

utbot-java-fuzzing/src/main/kotlin/org/utbot/fuzzing/spring/valid/ValidEntity.kt

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,20 @@ class ValidEntityValueProvider(
8787
classId = classId,
8888
modelName = "${noArgConstructorId.classId.name}${noArgConstructorId.parameters}#" + id.hex(),
8989
instantiationCall = UtExecutableCallModel(null, noArgConstructorId, params = emptyList()),
90-
modificationsChainProvider = { mutableListOf() }
91-
).fuzzed {
92-
summary = "%var% = ${classId.simpleName}()"
93-
}
94-
},
95-
modify = sequence {
96-
yield(Routine.Call(types = emptyList()) { self, _ ->
97-
val model = self.model as UtAssembleModel
98-
(model.modificationsChain as MutableList).addAll(
90+
modificationsChainProvider = {
9991
lifecycleState.entityManagerMethodsGetter().map { methodId ->
10092
UtExecutableCallModel(
10193
instance = UtSpringEntityManagerModel(),
10294
executable = methodId,
103-
params = listOf(model),
95+
params = listOf(this),
10496
)
105-
})
106-
})
107-
97+
}
98+
}
99+
).fuzzed {
100+
summary = "%var% = ${classId.simpleName}()"
101+
}
102+
},
103+
modify = sequence {
108104
// TODO maybe all fields
109105
findAccessibleModifiableFields(
110106
description,

0 commit comments

Comments
 (0)