main.kotlin.com.intuit.playerui.utils.test.RuntimePluginTest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of testutils Show documentation
Show all versions of testutils Show documentation
A cross-platform semantic rendering engine
The newest version!
package com.intuit.playerui.utils.test
import com.intuit.playerui.core.bridge.runtime.Runtime
import com.intuit.playerui.core.plugins.RuntimePlugin
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestTemplate
/**
* Extension of [RuntimeTest] which provides some structure for building and applying a [RuntimePlugin]. As denoted
* in the [RuntimeTest] docs, [TestTemplate]s will be executed for each [Runtime] on the classpath, while normal
* [Test]s will just be executed once.
*/
public abstract class RuntimePluginTest : RuntimeTest() {
protected lateinit var plugin: Plugin private set
@BeforeEach
protected fun setupPlugin() {
setupPlugin(buildPlugin())
}
/** Configure the provided [plugin] to be used for the upcoming test */
protected fun setupPlugin(plugin: Plugin) {
this.plugin = plugin
plugin.apply(runtime)
}
/** Method called during test setup to build the default version of the [plugin] */
protected abstract fun buildPlugin(): Plugin
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy