File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
utbot-framework/src/main/kotlin/org/utbot/framework/codegen Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,6 @@ package org.utbot.framework.codegen.domain.builtin
33import org.utbot.framework.plugin.api.BuiltinClassId
44
55internal val autowiredClassId = BuiltinClassId (
6- canonicalName = " org.springframework.beans.factory.annotation" ,
6+ canonicalName = " org.springframework.beans.factory.annotation.Autowired " ,
77 simpleName = " Autowired" ,
88)
Original file line number Diff line number Diff line change @@ -61,8 +61,7 @@ class SpringCodeGenerator(
6161 logger.info { " Code generation phase started at ${now()} " }
6262 val astConstructor = when (springTestsType) {
6363 SpringTestsType .UNIT_TESTS -> CgSpringUnitTestClassConstructor (context)
64- // TODO replace with CgSpringIntegrationTestClassConstructor
65- SpringTestsType .INTEGRATION_TESTS -> CgSpringUnitTestClassConstructor (context)
64+ SpringTestsType .INTEGRATION_TESTS -> CgSpringIntegrationTestClassConstructor (context)
6665 }
6766 val testClassFile = astConstructor.construct(testClassModel)
6867 logger.info { " Code generation phase finished at ${now()} " }
Original file line number Diff line number Diff line change 11package org.utbot.framework.codegen.tree
22
33import org.utbot.framework.codegen.domain.builtin.TestClassUtilMethodProvider
4+ import org.utbot.framework.codegen.domain.builtin.autowiredClassId
45import org.utbot.framework.codegen.domain.builtin.injectMocksClassId
56import org.utbot.framework.codegen.domain.builtin.mockClassId
67import org.utbot.framework.codegen.domain.context.CgContext
@@ -87,7 +88,11 @@ abstract class CgAbstractSpringTestClassConstructor(context: CgContext):
8788 groupedModelsByClassId : TypedModelWrappers ,
8889 annotationClassId : ClassId
8990 ): List <CgFieldDeclaration > {
90- require(annotationClassId == injectMocksClassId || annotationClassId == mockClassId) {
91+ require(
92+ annotationClassId == injectMocksClassId ||
93+ annotationClassId == mockClassId ||
94+ annotationClassId == autowiredClassId
95+ ) {
9196 error(" Unexpected annotation classId -- $annotationClassId " )
9297 }
9398
You can’t perform that action at this time.
0 commit comments