▲ BoardMapperTests.java - JUnit 테스트
페이지 정보
작성자 관리자 작성일 24-07-30 09:12 조회 603 댓글 0본문
package com.pkt.controller;
import java.util.List;
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;
import com.pkt.mapper.BoardMapper;
import com.pkt.model.BoardVO;
import lombok.Setter;
import lombok.extern.log4j.Log4j;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "file:src/main/webapp/WEB-INF/root-context.xml" })
@Log4j
public class BoardMapperTests {
@Setter(onMethod_ = @Autowired)
private BoardMapper mapper;
//@Test
public void testGetList() {
mapper.getList().forEach(board -> log.info(board));
}
@Test
public void testGetList2() {
List<BoardVO> list = mapper.getList();
for(BoardVO board : list) {
log.info(board);
}
}
}
댓글목록 0
등록된 댓글이 없습니다.