spring开发中,测试sql

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:applicationContext-native-test.xml" })
@Slf4j
public class ProductCfgDaoTest {


    @Autowired
    private ProductPartyCfgManager manager;

    @Test
    public void test1(){
        ProductPartyCfgPO productPartyCfgPO = manager.queryByTypeAndAgreement("7999", ProductTypeEnum.CONSUME.getKey());
        System.err.println(productPartyCfgPO);
    }
}

配置文件中配置连接池,以及测试类中引用的bean,还引入mybatis中的mapper文件

你可能感兴趣的:(mybatis,java基础)