Here are the files that I use:
component.xml
In Spring 2.1.5 at least, the XML file can be conveniently replaced by annotations. Piggy backing on @Sembrano's answer, I have this. "Look ma, no XML".
It appears I to had list all the classes I need @Autowired in the @ComponentScan
@RunWith(SpringJUnit4ClassRunner.class)
@ComponentScan(
basePackageClasses = {
OwnerService.class
})
@EnableAutoConfiguration
public class OwnerIntegrationTest {
@Autowired
OwnerService ownerService;
@Test
public void testOwnerService() {
Assert.assertNotNull(ownerService);
}
}