Skip to content

Commit

Permalink
chore: Remove uneeded com.michael-bull.kotlin-result:kotlin-result de…
Browse files Browse the repository at this point in the history
…pendency
  • Loading branch information
rholshausen committed Nov 21, 2024
1 parent 99740fa commit 8427c34
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 18 deletions.
1 change: 0 additions & 1 deletion provider/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ dependencies {
implementation 'com.vladsch.flexmark:flexmark:0.62.2'
implementation 'com.vladsch.flexmark:flexmark-ext-tables:0.62.2'
implementation 'org.apache.groovy:groovy'
implementation 'com.michael-bull.kotlin-result:kotlin-result:1.1.14'

testImplementation 'org.hamcrest:hamcrest'
testImplementation 'org.spockframework:spock-core'
Expand Down
1 change: 0 additions & 1 deletion provider/junit5/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ dependencies {
}

implementation 'org.slf4j:slf4j-api'
implementation 'com.michael-bull.kotlin-result:kotlin-result:1.1.14'

testRuntimeOnly 'ch.qos.logback:logback-classic'
testImplementation 'ru.lanwen.wiremock:wiremock-junit5:1.3.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import au.com.dius.pact.core.pactbroker.TestResult
import au.com.dius.pact.core.support.Result
import au.com.dius.pact.core.support.isNotEmpty
import com.github.ajalt.mordant.TermColors
import com.github.michaelbull.result.Err
import com.github.michaelbull.result.getError

private fun padLines(str: String, indent: Int): String {
val pad = " ".repeat(indent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ import au.com.dius.pact.core.support.json.JsonValue
import au.com.dius.pact.core.support.jsonArray
import au.com.dius.pact.core.support.jsonObject
import au.com.dius.pact.core.support.property
import au.com.dius.pact.core.support.Result
import au.com.dius.pact.provider.BodyComparisonResult
import au.com.dius.pact.provider.IConsumerInfo
import au.com.dius.pact.provider.IProviderInfo
import au.com.dius.pact.provider.IProviderVerifier
import au.com.dius.pact.provider.VerificationResult
import com.github.michaelbull.result.Err
import com.github.michaelbull.result.Ok
import org.apache.commons.lang3.exception.ExceptionUtils
import java.io.File
import java.time.ZonedDateTime
Expand Down Expand Up @@ -242,8 +241,8 @@ class JsonReporter(
.asObject()!!
verification["result"] = FAILED
verification["body"] = when (comparison) {
is Err<*> -> Json.toJson((comparison as Err<BodyTypeMismatch>).error.description())
is Ok<*> -> (comparison as Ok<BodyComparisonResult>).value.toJson()
is Result.Err<*> -> Json.toJson((comparison as Result.Err<BodyTypeMismatch>).error.description())
is Result.Ok<*> -> (comparison as Result.Ok<BodyComparisonResult>).value.toJson()
else -> Json.toJson(comparison)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ import au.com.dius.pact.core.pactbroker.VerificationNotice
import au.com.dius.pact.core.support.hasProperty
import au.com.dius.pact.core.support.json.JsonValue
import au.com.dius.pact.core.support.property
import au.com.dius.pact.core.support.Result
import au.com.dius.pact.provider.BodyComparisonResult
import au.com.dius.pact.provider.IConsumerInfo
import au.com.dius.pact.provider.IProviderInfo
import au.com.dius.pact.provider.IProviderVerifier
import au.com.dius.pact.provider.VerificationResult
import com.github.michaelbull.result.Err
import com.github.michaelbull.result.Ok
import com.vladsch.flexmark.ast.Heading
import com.vladsch.flexmark.ext.tables.TableBlock
import com.vladsch.flexmark.ext.tables.TableBody
Expand Down Expand Up @@ -424,12 +423,12 @@ class MarkdownReporter(
pw.write("&nbsp;&nbsp;&nbsp;&nbsp;has a matching body (<span style='color:red'>FAILED</span>) \n\n")

when (comparison) {
is Err<*> -> {
comparison as Err<BodyTypeMismatch>
is Result.Err<*> -> {
comparison as Result.Err<BodyTypeMismatch>
pw.write("```\n${comparison.error.description()}\n```\n")
}
is Ok<*> -> {
comparison as Ok<BodyComparisonResult>
is Result.Ok<*> -> {
comparison as Result.Ok<BodyComparisonResult>
pw.write("| Path | Failure |\n")
pw.write("| ---- | ------- |\n")
comparison.value.mismatches.forEach { (path, mismatches) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import au.com.dius.pact.core.model.Request
import au.com.dius.pact.core.model.RequestResponseInteraction
import au.com.dius.pact.core.model.Response
import au.com.dius.pact.core.support.json.JsonParser
import au.com.dius.pact.core.support.Result
import au.com.dius.pact.provider.BodyComparisonResult
import au.com.dius.pact.provider.ConsumerInfo
import au.com.dius.pact.provider.ProviderInfo
import com.github.michaelbull.result.Ok
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
import spock.lang.Specification
Expand Down Expand Up @@ -126,7 +126,7 @@ class JsonReporterSpec extends Specification {
new HeaderMismatch('HEADER-X', 'Y', '', "Expected a header 'HEADER-X' but was missing")
])
reporter.bodyComparisonFailed(
new Ok(new BodyComparisonResult([
new Result.Ok(new BodyComparisonResult([
'$.0': [
new BodyMismatch(
JsonParser.INSTANCE.parseString('{"doesNotExist":"Test","documentId":0}'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import au.com.dius.pact.core.matchers.HeaderMismatch
import au.com.dius.pact.core.model.Request
import au.com.dius.pact.core.model.RequestResponseInteraction
import au.com.dius.pact.core.model.Response
import au.com.dius.pact.core.support.Result
import au.com.dius.pact.provider.BodyComparisonResult
import au.com.dius.pact.provider.ConsumerInfo
import au.com.dius.pact.provider.ProviderInfo
import com.github.michaelbull.result.Ok
import spock.lang.Issue
import spock.lang.Specification
import au.com.dius.pact.core.support.json.JsonParser
Expand Down Expand Up @@ -103,7 +103,7 @@ class MarkdownReporterSpec extends Specification {
new HeaderMismatch('HEADER-X', 'Y', '', "Expected a header 'HEADER-X' but was missing")
])
reporter.bodyComparisonFailed(
new Ok(new BodyComparisonResult([
new Result.Ok(new BodyComparisonResult([
'$.0': [
new BodyMismatch(
JsonParser.parseString('{"doesNotExist":"Test","documentId":0}'),
Expand Down

0 comments on commit 8427c34

Please sign in to comment.