Junit测试

package com.hyxt;

import com.hyxt.cash.core.repository.ShopsInfoRepository;
import com.hyxt.cash.core.repository.ShopsInfoTempRepository;
import com.hyxt.cash.core.repository.ShopsLoginRepository;
import com.hyxt.cash.provider.Application;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * Created by huwei
 * Date:2015/9/15
 * Time:11:39
 */

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
public class TestShopsInfoServiceImpl {
    private static final Logger logger = LoggerFactory.getLogger(TestShopsInfoServiceImpl.class);
    @Autowired
    private ShopsInfoRepository shopsInfoRepository;
    @Autowired
    private ShopsInfoTempRepository shopsInfoTempRepository;
    @Autowired
    private ShopsLoginRepository shopsLoginRepository;
   /* @Test
    public void  getShopsInfo() {
        String phone="18814450543";
        ShopsInfoEntity shopsInfoEntity = shopsInfoRepository.findOne("mobile_phone=?1", phone);
        System.out.println("shopsInfoEntity ==" + shopsInfoEntity.getShopId() + " : storeId : == " + shopsInfoEntity.getStoreId());
        ShopsInfoVo shopsInfoVo = new ShopsInfoVo();
        BeanUtils.copyProperties(shopsInfoEntity, shopsInfoVo);
        System.out.println("vo.shopsInfoEntity ==" + shopsInfoVo.getShopId() + " : vo.storeId : == " + shopsInfoVo.getStoreId());

    }*/
   /* @Test
    public void  queryShopsInfo() {
        String openid="WEIXIN594986584545";
        StringBuffer sql = new StringBuffer();
        ShopsInfoVo shopsInfoVo = new ShopsInfoVo();
        sql.append("select distinct store_id from shops_login t where status ='1' and t.valid_date >= curdate() and open_id ='"+openId+"'");
        String storeId = (String)shopsLoginRepository.nativeQuery4Object(sql.toString());
        ShopsInfoEntity entity = shopsInfoRepository.findOne("store_id=?1", storeId);
        BeanUtils.copyProperties(entity, shopsInfoVo);

    }*/

}

相关推荐