유닛 테스트 쓰기

2397 단어 Java
아주 오래 전에 쓴 것 같다.
package com.xxx.dubbo;

import com.xxx.app.xx.xx.dao.MarketingRuleMapper;
import com.xxx.app.xx.xxx.dto.MarketingWayDTO;
import com.xxx.app.xx.xx.service.MarketingWayService;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

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

    @Autowired
    private MarxxxxxService marxxxxxService;
    @Test
    public void test(){

        MarxxxxDTO dto = new MarxxxxDTO();
        dto.setStrategyId("1");
        System.out.println("----------------------------------"+ marxxxxxService.find(dto));
    }
}
applicationContext-test.xml         :

    

    
    
    
    
    


좋은 웹페이지 즐겨찾기