테스트 코드 작성 방법
JpaRepository를 사용하지 않음 인터페이스 저장소를 생성하고 그 안에 메서드를 선언한 후 메서드를 재정의할 리포지토리를 만드는 memoryReposity 클래스 만들기 시험에 응시하다 package com.codehows.mobul.repository; import com.codehows.mobul.entity.Boards; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.TestPropertySource; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; @SpringBootTest @TestPropertySource(locations = “classpath:application-test.properties”) class BoardsRepositoryTest { MemoryBoardsRepository boardsRepository = new MemoryBoardsRepository(); @AfterEach public void afterEach(){ … Read more