From dfcd67f4db428aca83bb3c71d17259a71758e17e Mon Sep 17 00:00:00 2001 From: Ronald Holshausen Date: Fri, 12 Nov 2021 12:25:05 +1100 Subject: [PATCH] chore: fix test after cherry pick commits --- .../kotlin/au/com/dius/pact/provider/ProviderVerifier.kt | 6 +++++- .../pact/provider/DefaultVerificationReporterSpec.groovy | 4 ++-- .../au/com/dius/pact/provider/ProviderVerifierSpec.groovy | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/provider/src/main/kotlin/au/com/dius/pact/provider/ProviderVerifier.kt b/provider/src/main/kotlin/au/com/dius/pact/provider/ProviderVerifier.kt index 5adb3eabf5..f5eccd3312 100644 --- a/provider/src/main/kotlin/au/com/dius/pact/provider/ProviderVerifier.kt +++ b/provider/src/main/kotlin/au/com/dius/pact/provider/ProviderVerifier.kt @@ -248,6 +248,10 @@ interface IProviderVerifier { fun generateErrorStringFromVerificationResult(result: List): String fun reportStateChangeFailed(providerState: ProviderState, error: Exception, isSetup: Boolean) + + fun initialiseReporters(provider: IProviderInfo) + + fun reportVerificationForConsumer(consumer: IConsumerInfo, provider: IProviderInfo, pactSource: PactSource?) } /** @@ -770,7 +774,7 @@ open class ProviderVerifier @JvmOverloads constructor ( } } - fun initialiseReporters(provider: IProviderInfo) { + override fun initialiseReporters(provider: IProviderInfo) { reporters.forEach { if (it.hasProperty("displayFullDiff")) { (it.property("displayFullDiff") as KMutableProperty1) diff --git a/provider/src/test/groovy/au/com/dius/pact/provider/DefaultVerificationReporterSpec.groovy b/provider/src/test/groovy/au/com/dius/pact/provider/DefaultVerificationReporterSpec.groovy index 4aaafbc398..388e41e89e 100644 --- a/provider/src/test/groovy/au/com/dius/pact/provider/DefaultVerificationReporterSpec.groovy +++ b/provider/src/test/groovy/au/com/dius/pact/provider/DefaultVerificationReporterSpec.groovy @@ -94,7 +94,7 @@ class DefaultVerificationReporterSpec extends Specification { ], [:], new BrokerUrlSource('', '')) def testResult = new TestResult.Ok() def brokerClient = Mock(PactBrokerClient) - def branch = "main" + def branch = 'main' when: def result = DefaultVerificationReporter.INSTANCE.reportResults(pact, testResult, '', brokerClient, [], branch) @@ -115,7 +115,7 @@ class DefaultVerificationReporterSpec extends Specification { def testResult = new TestResult.Ok() def brokerClient = Mock(PactBrokerClient) def tags = ['tag1', 'tag2', 'tag3'] - def branch = "main" + def branch = 'main' when: def result = DefaultVerificationReporter.INSTANCE.reportResults(pact, testResult, '', brokerClient, tags, branch) diff --git a/provider/src/test/groovy/au/com/dius/pact/provider/ProviderVerifierSpec.groovy b/provider/src/test/groovy/au/com/dius/pact/provider/ProviderVerifierSpec.groovy index 1b4c1fc518..ba036c8859 100644 --- a/provider/src/test/groovy/au/com/dius/pact/provider/ProviderVerifierSpec.groovy +++ b/provider/src/test/groovy/au/com/dius/pact/provider/ProviderVerifierSpec.groovy @@ -454,7 +454,7 @@ class ProviderVerifierSpec extends Specification { } @Unroll - @SuppressWarnings('UnnecessaryGetter') + @SuppressWarnings(['UnnecessaryGetter', 'LineLength']) @RestoreSystemProperties def 'after verifying a pact, the results are reported back using branch and reportVerificationResults'() { given: @@ -481,7 +481,7 @@ class ProviderVerifierSpec extends Specification { verifier.pactReader.loadPact(_) >> mockPact mockPact.interactions >> [interaction1, interaction2] - def branch = "master" + def branch = 'master' System.setProperty(ProviderVerifier.PACT_PROVIDER_BRANCH, branch) when: