Spring 2.2.x folks .. was it just a bootiful dream...
# spring
r
Spring 2.2.x folks .. was it just a bootiful dream that one could use Constructor Injection in Junit5 Tests with SpringExtension? 🤔 🍃
👍 1
d
Constructor injection works
But i think you got to explicitly annotate params with @Autowired
r
Getting: org.junit.jupiter.api.extension.ParameterResolutionException: Failed to resolve parameter
d
Was using it with @SpringBootTest
r
Copy code
@WebFluxTest
@UnitTest
@AutoConfigureWireMock(port = 0)
@ExperimentalCoroutinesApi
internal class MyTest(
  @Autowired    
  private val myDep)
r
ah, they inject a test dependency ... I need one from the regular spring context. If that makes a difference
Works just fine now 👌🏻
d
👍