BoardServiceTests > SPRING_DATA_JPA

본문 바로가기

사이트 내 전체검색

뒤로가기 SPRING_DATA_JPA

BoardServiceTests

페이지 정보

작성자 관리자 작성일 24-06-17 15:22 조회 1,167 댓글 0

본문

package web.service;


import org.junit.jupiter.api.Test;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.boot.test.context.SpringBootTest;


import lombok.extern.log4j.Log4j2;

import web.dto.BoardDTO;


@SpringBootTest

@Log4j2

public class BoardServiceTests {


@Autowired

private BoardService boardService;


@Test

public void testRegister() {

log.info(boardService.getClass().getName());

//boardService 변수가 가르키는 객체의 클래스명을 출력하는데

//BoardServiceImpl을 감싸서 만든 클래스 정보가 출력된다.


BoardDTO boardDTO = BoardDTO.builder()

.title("서비스 계층")

.content("이용해 보자")

.writer("홍길동")

.build();


Long bno = boardService.register(boardDTO);


log.info("bno : "+bno);

}

}


댓글목록 0

등록된 댓글이 없습니다.


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