test: fix test

This commit is contained in:
usbharu 2025-02-19 13:16:58 +09:00
parent d696494100
commit 206b7fdbf5
Signed by: usbharu
GPG Key ID: 8CB1087135660B8D
2 changed files with 22 additions and 0 deletions

View File

@ -1,6 +1,8 @@
package wellknown
import dev.usbharu.hideout.SpringApplication
import org.flywaydb.core.Flyway
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired
@ -62,4 +64,13 @@ class HostMetaControllerTest {
.andExpect { status { isOk() } }
.andExpect { content { contentType(MediaType("application", "json")) } }
}
companion object {
@JvmStatic
@AfterAll
fun dropDatabase(@Autowired flyway: Flyway) {
flyway.clean()
flyway.migrate()
}
}
}

View File

@ -1,6 +1,8 @@
package wellknown
import dev.usbharu.hideout.SpringApplication
import org.flywaydb.core.Flyway
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired
@ -52,4 +54,13 @@ class WebFingerControllerTest {
}
.andExpect { status { isBadRequest() } }
}
companion object {
@JvmStatic
@AfterAll
fun dropDatabase(@Autowired flyway: Flyway) {
flyway.clean()
flyway.migrate()
}
}
}