From 206b7fdbf534a3d30fded145cd3dc8d70900e766 Mon Sep 17 00:00:00 2001 From: usbharu Date: Wed, 19 Feb 2025 13:16:58 +0900 Subject: [PATCH] test: fix test --- .../test/kotlin/wellknown/HostMetaControllerTest.kt | 11 +++++++++++ .../test/kotlin/wellknown/WebFingerControllerTest.kt | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/hideout/hideout-activitypub/src/test/kotlin/wellknown/HostMetaControllerTest.kt b/hideout/hideout-activitypub/src/test/kotlin/wellknown/HostMetaControllerTest.kt index f34906a8..0d571c1e 100644 --- a/hideout/hideout-activitypub/src/test/kotlin/wellknown/HostMetaControllerTest.kt +++ b/hideout/hideout-activitypub/src/test/kotlin/wellknown/HostMetaControllerTest.kt @@ -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() + } + } } \ No newline at end of file diff --git a/hideout/hideout-activitypub/src/test/kotlin/wellknown/WebFingerControllerTest.kt b/hideout/hideout-activitypub/src/test/kotlin/wellknown/WebFingerControllerTest.kt index 783a7e74..5a04645f 100644 --- a/hideout/hideout-activitypub/src/test/kotlin/wellknown/WebFingerControllerTest.kt +++ b/hideout/hideout-activitypub/src/test/kotlin/wellknown/WebFingerControllerTest.kt @@ -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() + } + } } \ No newline at end of file