All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.trendyol.stove.testing.e2e.KtorBridgeSystem.kt Maven / Gradle / Ivy

There is a newer version: 1f1ca59
Show newest version
package com.trendyol.stove.testing.e2e

import com.trendyol.stove.testing.e2e.system.*
import com.trendyol.stove.testing.e2e.system.abstractions.*
import com.trendyol.stove.testing.e2e.system.annotations.StoveDsl
import io.ktor.server.application.*
import org.koin.ktor.ext.*
import kotlin.reflect.KClass

/**
 * A system that provides a bridge between the test system and the application context.
 *
 * @property testSystem the test system to bridge.
 */
@StoveDsl
class KtorBridgeSystem(
  override val testSystem: TestSystem
) : PluggedSystem, AfterRunAwareWithContext, BridgeSystem(testSystem) {
  override fun  get(klass: KClass): D = ctx.getKoin().get(klass)
}

@StoveDsl
fun WithDsl.bridge(): TestSystem = this.testSystem.withBridgeSystem(KtorBridgeSystem(this.testSystem))




© 2015 - 2024 Weber Informatics LLC | Privacy Policy