Skip to content

Commit

Permalink
fix: support metadata mismatches from results from plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
rholshausen committed Feb 8, 2023
1 parent 1bee97d commit 21ada1b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package au.com.dius.pact.consumer

import au.com.dius.pact.consumer.model.MockProviderConfig
import au.com.dius.pact.core.matchers.BodyMismatch
import au.com.dius.pact.core.matchers.MetadataMismatch
import au.com.dius.pact.core.model.BasePact
import au.com.dius.pact.core.model.Pact
import au.com.dius.pact.core.support.contains
Expand Down Expand Up @@ -88,7 +89,11 @@ class PluginMockServer(pact: BasePact, config: MockProviderConfig) : BaseMockSer
PactVerificationResult.Error(RuntimeException(results.error), PactVerificationResult.Ok(testResult))
} else {
PactVerificationResult.PartialMismatch(results.mismatches.map {
BodyMismatch(it.expected, it.actual, it.mismatch, it.path, it.diff)
if (it.mismatchType == "metadata") {
MetadataMismatch(it.path, it.expected, it.actual, it.mismatch)
} else {
BodyMismatch(it.expected, it.actual, it.mismatch, it.path, it.diff)
}
})
}
})
Expand Down

0 comments on commit 21ada1b

Please sign in to comment.