Spring support JUnit quite well on that: With the RunWith and ContextConfiguration annotation, things look very intuitive
RunWith
ContextConfiguration
@RunWith(
It works with TestNG as well. Your test class needs to extend one of the following classes: