net.serenitybdd.reports.configuration.StringReportProperty.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of serenity-machinereadable-reports Show documentation
Show all versions of serenity-machinereadable-reports Show documentation
Serenity machine-readable reports
The newest version!
package net.serenitybdd.reports.configuration
import net.serenitybdd.core.environment.EnvironmentSpecificConfiguration
import net.thucydides.core.ThucydidesSystemProperty
import net.thucydides.core.util.EnvironmentVariables
class StringReportProperty(val property: String, val defaultValue: String) : ReportProperty {
constructor(property: ThucydidesSystemProperty, defaultValue: String) : this(property.toString(), defaultValue)
override fun configuredIn(environmentVariables: EnvironmentVariables) : String {
return EnvironmentSpecificConfiguration.from(environmentVariables)
.getOptionalProperty(property)
.orElse(defaultValue)
// return environmentVariables.getProperty(property, defaultValue)
}
}