generated from pricelees/issue-pr-template
refactor: \@SpringBootTest 에서의 테스트 종료 후 테이블 롤백 스크립트 적용
This commit is contained in:
parent
bc8ab29355
commit
f517752e44
@ -8,6 +8,7 @@ import jakarta.persistence.EntityManager
|
||||
import org.hamcrest.Matchers.equalTo
|
||||
import org.springframework.boot.test.context.SpringBootTest
|
||||
import org.springframework.boot.test.web.server.LocalServerPort
|
||||
import org.springframework.test.context.jdbc.Sql
|
||||
import org.springframework.transaction.support.TransactionTemplate
|
||||
import roomescape.theme.business.ThemeService
|
||||
import roomescape.theme.util.TestThemeCreateUtil
|
||||
@ -20,13 +21,13 @@ import kotlin.random.Random
|
||||
* 날짜 범위, 예약 수만 검증
|
||||
*/
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@Sql(value = ["/truncate.sql"], executionPhase = Sql.ExecutionPhase.AFTER_TEST_CLASS)
|
||||
class MostReservedThemeAPITest(
|
||||
@LocalServerPort val port: Int,
|
||||
val themeService: ThemeService,
|
||||
val transactionTemplate: TransactionTemplate,
|
||||
val entityManager: EntityManager,
|
||||
) : FunSpec() {
|
||||
|
||||
init {
|
||||
beforeSpec {
|
||||
transactionTemplate.executeWithoutResult {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user