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 do this:

```
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class MyTest {

  @Test
  public void testSomething() {

  }

  @Configuration
  @ComponentScan("basepackage")
  public static class SpringConfig {

  }
}

```

By default `@ContextConfiguration` will look for static inner classes annotated with `@Configuration`, which is why this set up will just work.

You can get rid of loader param altogether, that is not required
You can also simply add `@SpringBootTest` if using Spring Boot.