Skip to content

Commit

Permalink
fix: correct the loading of pacts with the Maven plugin #885
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Holshausen committed Jun 2, 2019
1 parent 836208a commit eec764b
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -3,6 +3,8 @@ package au.com.dius.pact.provider
import au.com.dius.pact.model.FileSource
import au.com.dius.pact.model.Interaction
import groovy.json.JsonSlurper
import org.apache.commons.io.FileUtils
import org.apache.commons.io.FilenameUtils
import org.apache.commons.lang3.BooleanUtils
import org.fusesource.jansi.AnsiConsole
import java.io.File
Expand Down Expand Up @@ -38,7 +40,7 @@ object ProviderUtils {
AnsiConsole.out().println("Loading pact files for provider ${provider.name} from $pactFileDir")

val consumers = mutableListOf<ConsumerInfo>()
for (f in pactFileDir.listFiles { f, _ -> f.extension == "json" }) {
for (f in pactFileDir.listFiles { _, name -> FilenameUtils.isExtension(name, "json") }) {
val pactJson = JsonSlurper().parse(f) as Map<String, Any>
val providerName = extractFromMap(pactJson, "provider", "name")
if (providerName == provider.name) {
Expand Down

0 comments on commit eec764b

Please sign in to comment.