Skip to content

Commit 14f5dcb

Browse files
committed
Remove redundant code
1 parent 18a78ea commit 14f5dcb

File tree

2 files changed

+0
-44
lines changed

2 files changed

+0
-44
lines changed

utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/util/SpringModelUtils.kt

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -252,41 +252,6 @@ object SpringModelUtils {
252252
fun createMockMvcModel(idGenerator: () -> Int) =
253253
createBeanModel("mockMvc", idGenerator(), mockMvcClassId)
254254

255-
fun createGetMockMvcResponseModel(requestBuilderModel: UtModel, idGenerator: () -> Int): UtModel {
256-
val mockMvcModel = createMockMvcModel(idGenerator)
257-
val performModel = UtAssembleModel(
258-
id = idGenerator(),
259-
classId = resultActionsClassId,
260-
modelName = "perform",
261-
instantiationCall = UtExecutableCallModel(
262-
instance = mockMvcModel,
263-
executable = mockMvcPerformMethodId,
264-
params = listOf(requestBuilderModel)
265-
)
266-
)
267-
// TODO add `andDo(print())`
268-
val andReturnModel = UtAssembleModel(
269-
id = idGenerator(),
270-
classId = mvcResultClassId,
271-
modelName = "andReturn",
272-
instantiationCall = UtExecutableCallModel(
273-
instance = performModel,
274-
executable = resultActionsAndReturnMethodId,
275-
params = listOf()
276-
)
277-
)
278-
return UtAssembleModel(
279-
id = idGenerator(),
280-
classId = mockHttpServletResponseClassId,
281-
modelName = "getResponse",
282-
instantiationCall = UtExecutableCallModel(
283-
instance = andReturnModel,
284-
executable = mvcResultGetResponseMethodId,
285-
params = listOf()
286-
)
287-
)
288-
}
289-
290255
fun createRequestBuilderModelOrNull(methodId: MethodId, arguments: List<UtModel>, idGenerator: () -> Int): UtModel? {
291256
check(methodId.parameters.size == arguments.size)
292257

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/CgSpringVariableConstructor.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import org.utbot.framework.codegen.domain.models.CgValue
77
import org.utbot.framework.plugin.api.ClassId
88
import org.utbot.framework.plugin.api.UtModel
99
import org.utbot.framework.plugin.api.UtSpringContextModel
10-
import org.utbot.framework.plugin.api.UtSpringMockMvcResultActionsModel
1110
import org.utbot.framework.plugin.api.util.stringClassId
1211

1312
class CgSpringVariableConstructor(context: CgContext) : CgVariableConstructor(context) {
@@ -36,12 +35,4 @@ class CgSpringVariableConstructor(context: CgContext) : CgVariableConstructor(co
3635
valueByUtModelWrapper[UtSpringContextModel.wrap()] = it
3736
}
3837
}
39-
40-
override fun constructValueByModel(model: UtModel, name: String?): CgValue = when (model) {
41-
is UtSpringMockMvcResultActionsModel -> CgLiteral(
42-
model.classId,
43-
"UtSpringMockMvcResult(${model.status}, ${model.errorMessage}, ${model.contentAsString}, ${model.viewName})"
44-
)
45-
else -> super.constructValueByModel(model, name)
46-
}
4738
}

0 commit comments

Comments
 (0)