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
#!/bin/sh | |
set -e | |
######## KTLINT-GRADLE HOOK START ######## | |
CHANGED_FILES="$(git --no-pager diff --name-status --no-color --cached | awk '$1 ~ /^R/ {print $3}; $1 != "D" && $2 ~ /\.kts|\.kt/ {print $2}')" | |
if [ -z "$CHANGED_FILES" ]; then | |
echo "No Kotlin staged files." | |
exit 0 | |
fi; |
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
@Pact(consumer = "fulfillment-service", provider = "order-service") | |
fun exportAnOrderTo(builder: MessagePactBuilder): MessagePact = builder.hasPactWith("order-service") | |
.given("An order with three items") | |
.expectsToReceive("an order to export") | |
.withContent( | |
newJsonBody { o -> | |
o.stringType("customerId", testCustomerId) | |
o.array("items") { a -> | |
a.newObject { item -> | |
item.stringType("name", "A Teddy Bear") |