IT/development

[spring] egovframework jUnit 4 template

알 수 없는 사용자 2023. 12. 17. 18:31
반응형
package egovframework.admin.sys.bbs.mst.service.impl;

import egovframework.admin.sys.bbs.mst.dto.BbsMstVO;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Commit;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import java.util.List;


@RunWith(SpringJUnit4ClassRunner.class)
//context로 시작하는 모든 bean xml파일 참조(context-aspect.xml, context-common.xml 등등)
@ContextConfiguration(locations = {"classpath*:egovframework/spring/com/**/context-*.xml"})
@WebAppConfiguration
public class BbsMstDAOTest {
	// DI
    @Autowired
    private BbsMstDAO bbsMstDAO;

    @Test
//    @Ignore	
    public void 목록ok() {
        BbsMstVO b = new BbsMstVO();
        List<BbsMstVO> list = bbsMstDAO.selectBbsMstList(b);
    }

    @Test
    @Ignore
    public void 상세ok() {
         BbsMstVO b = new BbsMstVO();
//         b.setBbsId(1);
        BbsMstVO detail = bbsMstDAO.selectBbsMstDetail(b);
    }
}

요즘 프로젝트 때문에 포스팅할 시간이 없네..

반응형