▲ BoardMapperTests.java
페이지 정보

본문
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);
}
}
}
[콘솔 내용]
INFO : com.pkt.controller.BoardMapperTests - BoardVO(bno=1, title=제목 이란다., content=내용이란다., writer=1111, regdate=Tue Jul 30 09:07:45 KST 2024, viewcnt=0)
- 이전글BoardMapper.xml 24.07.30
- 다음글● ① 모델 및 mapper 구현 24.07.30
댓글목록
등록된 댓글이 없습니다.