
wisp.deployment.FakeEnvironmentVariableLoader.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wisp-deployment-testing Show documentation
Show all versions of wisp-deployment-testing Show documentation
a module containing deployment testing helpers, e.g. fakes
The newest version!
package wisp.deployment
/**
* A Fake [EnvironmentVariableLoader] that loads from an in memory map
*/
class FakeEnvironmentVariableLoader(val vars: MutableMap = mutableMapOf()) :
EnvironmentVariableLoader {
override fun getEnvironmentVariable(name: String): String {
return vars[name] ?: throw IllegalStateException("$name environment variable not set")
}
override fun getEnvironmentVariableOrDefault(name: String, defaultValue: String): String {
return vars[name] ?: defaultValue
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy