-
-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implemented pact broker client support for provider-pacts-for-v…
…erification endpoint #942
- Loading branch information
Ronald Holshausen
committed
Mar 22, 2020
1 parent
85c3bdb
commit 7027da8
Showing
7 changed files
with
250 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
core/pact-broker/src/main/kotlin/au/com/dius/pact/core/pactbroker/PactBrokerConsumer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,38 @@ | ||
package au.com.dius.pact.core.pactbroker | ||
|
||
import au.com.dius.pact.core.support.Json | ||
import com.google.gson.JsonElement | ||
|
||
@Deprecated(message = "Use PactResult instead", replaceWith = ReplaceWith("PactResult")) | ||
data class PactBrokerConsumer @JvmOverloads constructor ( | ||
val name: String, | ||
val source: String, | ||
val pactBrokerUrl: String, | ||
val pactFileAuthentication: List<String> = listOf(), | ||
val tag: String? = null | ||
) | ||
|
||
data class PactResult( | ||
val name: String, | ||
val source: String, | ||
val pactBrokerUrl: String, | ||
val pactFileAuthentication: List<String> = listOf(), | ||
val notices: List<VerificationNotice> | ||
) { | ||
companion object { | ||
fun fromConsumer(consumer: PactBrokerConsumer) = | ||
PactResult(consumer.name, consumer.source, consumer.pactBrokerUrl, consumer.pactFileAuthentication, emptyList()) | ||
} | ||
} | ||
|
||
data class VerificationNotice( | ||
val `when`: String, | ||
val text: String | ||
) { | ||
companion object { | ||
fun fromJson(json: JsonElement): VerificationNotice { | ||
val jsonObj = json.asJsonObject | ||
return VerificationNotice(Json.toString(jsonObj["when"]), Json.toString(jsonObj["text"])) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.