鍍金池/ 問答/Java  數(shù)據(jù)庫  Office/ Invalid bound statement (not found)

Invalid bound statement (not found)

1、spring boot +mybatis 開發(fā)集成測試時報錯org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):;但是Application啟動正常

啟動加載實體類正常

2017-11-07 17:25:56.938 |-DEBUG [main] org.mybatis.spring.mapper.ClassPathMapperScanner [294] -| Identified candidate component class: file [D:\work\SRC-JAVA\xxx-scm-warehouse-outbound\target\classes\com\xxx\scm\wms\infrastructure\persistence\dao\StPickinglistHeadRepository.class]
2017-11-07 17:26:34.107 |-DEBUG [main] org.mybatis.spring.mapper.ClassPathMapperScanner [181] -| Creating MapperFactoryBean with name 'stPickinglistHeadRepository' and 'com.xxx.scm.wms.infrastructure.persistence.dao.StPickinglistHeadRepository' mapperInterface

但是最后報錯
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.xxx.scm.wms.infrastructure.persistence.dao.StPickinglistHeadRepository.selectStPickinglistHeadByBillNo

2、代碼

@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Application.class)
public class PickingListOrderServiceImplTestGetBaseInfoByOrderNoUT {
    @Autowired
    PickingListOrderService pickingListOrderService;
//    本地測試通過
    @Test
    public void testGetBaseInfoByOrderNo1() throws Exception {
         String billNo = "MOCK-EXIST-001";
        //執(zhí)行被測試方法
        Optional<StPickinglistHeadDTO> dto = pickingListOrderService.getBaseInfoByOrderNo(billNo);
        StPickinglistHeadDTO stdto = dto.get();
        TestCase.assertEquals("MOCK-EXIST-001", stdto.getBillNo());
        TestCase.assertEquals("02", stdto.getBillType());
    }

啟動的過程和正式Application日志都一致;但是Application正常;對了所有此類的集成測試都報上述錯誤??!

回答
編輯回答
扯機薄

先看看這篇文章能解決問題嗎

https://my.oschina.net/hebaod...

2017年5月17日 13:58