Question: For example, now in each test class I have to do

```
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(loader=AnnotationConfigContextLoader.class)

```

I want to get rid of 

```
 @ContextConfiguration(loader=AnnotationConfigContextLoader.class)

```

and want Spring to scan all the beans in my project.

How can I do that?

Answer: 
You can also simply add `@SpringBootTest` if using Spring Boot.
```
    @TestConfiguration 
    @ComponentScan("basepackage")
    public class TestConfig{

    }

```

Adding a config class lets spring to load application context.
This solved this issue for me.