package kr.co.jinwoosi.clfd.clfd.dgns.service;

import kr.co.jinwoosi.clfd.clfd.dgns.model.DgnsAns;
import kr.co.jinwoosi.clfd.clfd.dgns.model.DgnsAnsSearch;
import kr.co.jinwoosi.clfd.clfd.dgns.model.DgnsAskSearch;
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:config/spring/context-datasource.xml",
        "classpath:config/spring/context-mybatis.xml",
        "classpath:config/spring/context-common.xml",
        "classpath:config/spring/context-transaction.xml"
})
public class DgnsAnsServiceTest {

    @Autowired
    private DgnsAnsService dgnsAnsService;

    @Test
    public void selectListTest() {
        DgnsAnsSearch dgnsAnsSearch = new DgnsAnsSearch();
        dgnsAnsSearch.setDgnsAskId(2L);
        dgnsAnsService.selectList(dgnsAnsSearch).forEach(System.out::println);
    }

    @Test
    public void selectTest() {
        DgnsAnsSearch dgnsAnsSearch = new DgnsAnsSearch();
        dgnsAnsSearch.setDgnsAnsId(10L);
        DgnsAns select = dgnsAnsService.select(dgnsAnsSearch);
        System.out.println(select.toString());
    }
}
