Skip to content

Commit 85c3bdb

Browse files
author
Ronald Holshausen
authoredMar 21, 2020
Merge pull request #1050 from arhohuttunen/fix-1049
fix: publish verification results when Pact URL is overridden #1049
2 parents 01d8235 + f8997d7 commit 85c3bdb

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed
 

‎provider/pact-jvm-provider-junit/src/test/groovy/au/com/dius/pact/provider/junit/loader/PactBrokerLoaderSpec.groovy

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package au.com.dius.pact.provider.junit.loader
22

3+
import au.com.dius.pact.core.model.BrokerUrlSource
34
import au.com.dius.pact.core.model.Pact
45
import au.com.dius.pact.core.model.PactBrokerSource
5-
import au.com.dius.pact.core.model.UrlSource
66
import au.com.dius.pact.core.pactbroker.IHalClient
77
import au.com.dius.pact.core.pactbroker.InvalidHalResponse
88
import au.com.dius.pact.core.pactbroker.PactBrokerClient
@@ -383,7 +383,8 @@ class PactBrokerLoaderSpec extends Specification {
383383
tags = ['demo']
384384
PactBrokerLoader loader = Spy(pactBrokerLoader())
385385
loader.overridePactUrl('http://overridden.com', 'overridden')
386-
def consumer = new ConsumerInfo('overridden', null, true, [], null, new UrlSource('http://overridden.com'))
386+
def brokerUrlSource = new BrokerUrlSource('http://overridden.com', 'http://pactbroker:1234')
387+
def consumer = new ConsumerInfo('overridden', null, true, [], null, brokerUrlSource)
387388

388389
when:
389390
def result = loader.load('test')

‎provider/pact-jvm-provider/src/main/kotlin/au/com/dius/pact/provider/junit/loader/PactBrokerLoader.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package au.com.dius.pact.provider.junit.loader
22

3+
import au.com.dius.pact.core.model.BrokerUrlSource
34
import au.com.dius.pact.core.model.Consumer
45
import au.com.dius.pact.core.model.DefaultPactReader
56
import au.com.dius.pact.core.model.Interaction
67
import au.com.dius.pact.core.model.Pact
78
import au.com.dius.pact.core.model.PactBrokerSource
89
import au.com.dius.pact.core.model.PactReader
9-
import au.com.dius.pact.core.model.UrlSource
1010
import au.com.dius.pact.core.model.PactSource
1111
import au.com.dius.pact.core.pactbroker.PactBrokerClient
1212
import au.com.dius.pact.core.support.expressions.ExpressionParser.parseExpression
@@ -78,8 +78,9 @@ open class PactBrokerLoader(
7878
val resolver = setupValueResolver()
7979
val pacts = when {
8080
overriddenPactUrl.isNotEmpty() -> {
81-
val pactBrokerClient = newPactBrokerClient(brokerUrl(resolver).build(), resolver)
82-
val pactSource = UrlSource<Interaction>(overriddenPactUrl!!)
81+
val brokerUri = brokerUrl(resolver).build()
82+
val pactBrokerClient = newPactBrokerClient(brokerUri, resolver)
83+
val pactSource = BrokerUrlSource(overriddenPactUrl!!, brokerUri.toString())
8384
pactSource.encodePath = false
8485
listOf(loadPact(ConsumerInfo(name = overriddenConsumer!!, pactSource = pactSource),
8586
pactBrokerClient.options))

0 commit comments

Comments
 (0)
Please sign in to comment.