▲ BoardMapperTests.java > SPRING1

본문 바로가기

사이트 내 전체검색

뒤로가기 SPRING1

▲ BoardMapperTests.java

페이지 정보

작성자 관리자 작성일 24-07-30 09:47 조회 664 댓글 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);

}

}

}





[콘솔 내용]

INFO : com.pkt.controller.BoardMapperTests - BoardVO(bno=1, title=제목 이란다., content=내용이란다., writer=1111, regdate=Tue Jul 30 09:07:45 KST 2024, viewcnt=0)



댓글목록 0

등록된 댓글이 없습니다.


Copyright © dancePKT. All rights reserved.
PC 버전으로 보기