File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
model-server/src/test/kotlin/org/modelix/model/server Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -46,3 +46,17 @@ fun runWithNettyServer(
4646 nettyServer.stop()
4747 }
4848}
49+
50+ fun runTestApplication (block : suspend ApplicationTestBuilder .() -> Unit ) {
51+ val previousDevMode = System .getProperty(" io.ktor.development" )
52+ System .setProperty(" io.ktor.development" , " false" )
53+ try {
54+ io.ktor.server.testing.testApplication(block)
55+ } finally {
56+ if (previousDevMode == null ) {
57+ System .clearProperty(" io.ktor.development" )
58+ } else {
59+ System .setProperty(" io.ktor.development" , previousDevMode)
60+ }
61+ }
62+ }
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ import io.ktor.client.statement.HttpResponse
1717import io.ktor.client.statement.bodyAsText
1818import io.ktor.http.HttpStatusCode
1919import io.ktor.server.testing.ApplicationTestBuilder
20- import io.ktor.server.testing.testApplication
2120import io.mockk.clearAllMocks
2221import io.mockk.coEvery
2322import io.mockk.every
@@ -42,6 +41,7 @@ import org.modelix.model.persistent.CPNode
4241import org.modelix.model.persistent.CPNodeRef
4342import org.modelix.model.server.handlers.RepositoriesManager
4443import org.modelix.model.server.installDefaultServerPlugins
44+ import org.modelix.model.server.runTestApplication
4545import kotlin.test.BeforeTest
4646import kotlin.test.Test
4747
@@ -308,7 +308,7 @@ class DiffViewTest {
308308 val v1 = createCLVersion { it }
309309 val v2 = createCLVersion(v1) { it }
310310
311- private fun runDiffViewTest (block : suspend ApplicationTestBuilder .() -> Unit ) = testApplication {
311+ private fun runDiffViewTest (block : suspend ApplicationTestBuilder .() -> Unit ) = runTestApplication {
312312 application {
313313 installDefaultServerPlugins()
314314 DiffView (repositoriesManager).init (this )
You can’t perform that action at this time.
0 commit comments