@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:applicationContext.xml")
public class CustomerDaoTest {
@Autowired
CustomerDao customerDao;
@Test
public void findAll(){
List<Customer> customerList = customerDao.findAll();
System.out.println(customerList);
}
}
原因:junit我版本是4.9,起码得4.12或以上!