④ BoardRepositoryTest ( remove ) > SPRING_DATA_JPA

본문 바로가기

사이트 내 전체검색

뒤로가기 SPRING_DATA_JPA

④ BoardRepositoryTest ( remove )

페이지 정보

작성자 관리자 작성일 24-06-28 12:20 조회 70 댓글 0

본문

package web.repository;


import java.util.Optional;

import java.util.UUID;

import java.util.stream.IntStream;


import org.junit.jupiter.api.Test;

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

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

import org.springframework.data.domain.Page;

import org.springframework.data.domain.PageRequest;

import org.springframework.data.domain.Pageable;

import org.springframework.data.domain.Sort;

import org.springframework.test.annotation.Commit;


import jakarta.transaction.Transactional;

import lombok.extern.log4j.Log4j2;

import web.domain.Board;

import web.domain.BoardImage;

import web.dto.BoardListReplyCountDTO;


@SpringBootTest

@Log4j2

public class BoardRepositoryTest {


@Autowired

private BoardRepository boardRepository;


@Autowired

private ReplyRepository replyRepository;


@Transactional

@Commit

@Test

public void testRemoveAll() {

Long bno = 1L;


replyRepository.deleteByBoard_Bno(bno);


boardRepository.deleteById(bno);

}

...

}


댓글목록 0

등록된 댓글이 없습니다.


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