当前位置: 代码迷 >> Java相关 >> junit测试spring脑袋注入方式
  详细解决方案

junit测试spring脑袋注入方式

热度:92   发布时间:2016-04-22 19:53:06.0
junit测试spring头部注入方式
@RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration(locations = { "classpath:/applicationContext.xml" })@TestExecutionListeners({ DependencyInjectionTestExecutionListener.class })public class ServiceAttachmentServiceImplTest {    @Resource    private IServiceAttachmentService serviceAttachmentService;    @Test//测试SQL语句    public void testSQL() {        List<ServiceAttachment> atts = serviceAttachmentService                .getScrollData().getResultList();        }        

重点是头部注解

  相关解决方案