▲ BoardMapperTests.java - JUnit 테스트
페이지 정보
본문
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);
}
}
}
- 이전글BoardMapper.java ( interface ) 24.07.30
- 다음글◆ tbl_board - 게시판 테이블 생성 24.07.29
댓글목록
등록된 댓글이 없습니다.