Skip to content

Commit

Permalink
Revert "chore: remove system property fallback from SpringEnvironment…
Browse files Browse the repository at this point in the history
…Resolver #1023"

This reverts commit 0312084.
  • Loading branch information
Ronald Holshausen committed Mar 7, 2020
1 parent 0312084 commit 436a5e8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package au.com.dius.pact.provider.spring

import au.com.dius.pact.core.support.expressions.SystemPropertyResolver
import au.com.dius.pact.core.support.expressions.ValueResolver
import au.com.dius.pact.core.support.isNotEmpty
import org.springframework.core.env.Environment

class SpringEnvironmentResolver(private val environment: Environment) : ValueResolver {
override fun resolveValue(property: String?): String? {
return if (property.isNotEmpty()) environment.getProperty(property) else null
val tuple = SystemPropertyResolver.PropertyValueTuple(property).invoke()
return environment.getProperty(tuple.propertyName, tuple.defaultValue)
}

override fun propertyDefined(property: String) = environment.containsProperty(property)
Expand Down

0 comments on commit 436a5e8

Please sign in to comment.