Writing JUnit test cases in Spring: adding spring-test to pom.xml and loading the application context in the test.