pl.allegro.tech.servicemesh.envoycontrol.config.service.GenericServiceExtension.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of envoy-control-tests Show documentation
Show all versions of envoy-control-tests Show documentation
Production-ready Control Plane for Service Mesh based on Envoy Proxy.
package pl.allegro.tech.servicemesh.envoycontrol.config.service
import org.junit.jupiter.api.extension.ExtensionContext
import pl.allegro.tech.servicemesh.envoycontrol.logger
class GenericServiceExtension(private val container: T) : ServiceExtension {
private val logger by logger()
private var started = false
override fun container() = container
override fun beforeAll(context: ExtensionContext) {
if (started) {
return
}
logger.info("Generic service is starting.")
container.start()
started = true
logger.info("Generic service extension started.")
}
override fun afterAll(context: ExtensionContext) {
container.stop()
}
}