https://kotlinlang.org logo
#spring
Title
# spring
m

max.

01/23/2017, 5:47 PM
Hi, I want to use
@Autowired
in my tests. So I have a class annotated with
@Repository
and test that looks like the following
Copy code
@RunWith(SpringJUnit4ClassRunner::class)
@ContextConfiguration
@ActiveProfiles("test")
class MyTest {
    @Autowired lateinit var repo: MyRepository
}
With all this I get the error
Could not autowire. No beans of 'MyRepository' type found
. Any ideas how to fix it without xml config files?🙂