From ea65ae355369d37b1fe56fd118a0e1ceef67eba4 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Thu, 10 Jan 2019 16:04:32 +0100 Subject: [PATCH] Added latest version support for git storage without this change you always have to pass the concrete version for git based storage with this change we support passing of a latests version fixes gh-745 --- docs/src/main/asciidoc/verifier_faq.adoc | 9 +- pom.xml | 5 + spring-cloud-contract-shade/pom.xml | 5 + .../stubrunner/ScmStubDownloaderBuilder.java | 121 ++++++++++- .../stubrunner/GitStubDownloaderTests.java | 130 ++++++++++- .../cloud/contract/stubrunner/TestUtils.java | 1 + .../shouldSendAcceptedVerification.groovy | 33 +++ .../shouldSendRejectedVerification.groovy | 33 +++ .../rest/shouldGrantABeerIfOldEnough.groovy | 37 ++++ .../rest/shouldRejectABeerIfTooYoung.groovy | 37 ++++ .../rest/shouldGrantABeerIfOldEnough.json | 24 +++ .../rest/shouldRejectABeerIfTooYoung.json | 24 +++ .../shouldSendAcceptedVerification.groovy | 33 +++ .../shouldSendRejectedVerification.groovy | 33 +++ .../rest/shouldGrantABeerIfOldEnough.groovy | 37 ++++ .../rest/shouldRejectABeerIfTooYoung.groovy | 37 ++++ .../rest/shouldGrantABeerIfOldEnough.json | 24 +++ .../rest/shouldRejectABeerIfTooYoung.json | 24 +++ .../shouldSendAcceptedVerification.groovy | 33 +++ .../shouldSendRejectedVerification.groovy | 33 +++ .../rest/shouldGrantABeerIfOldEnough.groovy | 37 ++++ .../rest/shouldRejectABeerIfTooYoung.groovy | 37 ++++ .../rest/shouldGrantABeerIfOldEnough.json | 24 +++ .../rest/shouldRejectABeerIfTooYoung.json | 24 +++ .../shouldSendAcceptedVerification.groovy | 33 +++ .../shouldSendRejectedVerification.groovy | 33 +++ .../rest/shouldGrantABeerIfOldEnough.groovy | 37 ++++ .../rest/shouldRejectABeerIfTooYoung.groovy | 37 ++++ .../rest/shouldGrantABeerIfOldEnough.json | 24 +++ .../rest/shouldRejectABeerIfTooYoung.json | 24 +++ .../git_samples/contract-git/git/config | 3 - .../git_samples/contract-git/git/index | Bin 2445 -> 8274 bytes .../git_samples/contract-git/git/logs/HEAD | 1 + .../contract-git/git/logs/refs/heads/master | 1 + .../1e/c084220c52398ce8cd2f8235018019504030f2 | Bin 0 -> 67 bytes .../2b/42d52aec21936e5578be5ea0e2fdb9c539ce88 | Bin 0 -> 84 bytes .../3b/d42890d5105a30abd82d0205b63cbf20a59e83 | 1 + .../83/1a7e732650ab7428f60d51ba7d9ea33c51cf26 | Bin 0 -> 88 bytes .../b4/fc3812c95e3f5eed2ac1964a131464293786aa | Bin 0 -> 127 bytes .../contract-git/git/refs/heads/master | 2 +- .../contract-predefined-names-git/LICENSE.txt | 202 ++++++++++++++++++ .../shouldSendAcceptedVerification.groovy | 33 +++ .../shouldSendRejectedVerification.groovy | 33 +++ .../rest/shouldGrantABeerIfOldEnough.groovy | 37 ++++ .../rest/shouldRejectABeerIfTooYoung.groovy | 37 ++++ .../rest/shouldGrantABeerIfOldEnough.json | 24 +++ .../rest/shouldRejectABeerIfTooYoung.json | 24 +++ .../shouldSendAcceptedVerification.groovy | 33 +++ .../shouldSendRejectedVerification.groovy | 33 +++ .../rest/shouldGrantABeerIfOldEnough.groovy | 37 ++++ .../rest/shouldRejectABeerIfTooYoung.groovy | 37 ++++ .../rest/shouldGrantABeerIfOldEnough.json | 24 +++ .../rest/shouldRejectABeerIfTooYoung.json | 24 +++ .../shouldSendAcceptedVerification.groovy | 33 +++ .../shouldSendRejectedVerification.groovy | 33 +++ .../rest/shouldGrantABeerIfOldEnough.groovy | 37 ++++ .../rest/shouldRejectABeerIfTooYoung.groovy | 37 ++++ .../rest/shouldGrantABeerIfOldEnough.json | 24 +++ .../rest/shouldRejectABeerIfTooYoung.json | 24 +++ .../shouldSendAcceptedVerification.groovy | 33 +++ .../shouldSendRejectedVerification.groovy | 33 +++ .../rest/shouldGrantABeerIfOldEnough.groovy | 37 ++++ .../rest/shouldRejectABeerIfTooYoung.groovy | 37 ++++ .../rest/shouldGrantABeerIfOldEnough.json | 24 +++ .../rest/shouldRejectABeerIfTooYoung.json | 24 +++ .../shouldSendAcceptedVerification.groovy | 33 +++ .../shouldSendRejectedVerification.groovy | 33 +++ .../rest/shouldGrantABeerIfOldEnough.groovy | 37 ++++ .../rest/shouldRejectABeerIfTooYoung.groovy | 37 ++++ .../rest/shouldGrantABeerIfOldEnough.json | 24 +++ .../rest/shouldRejectABeerIfTooYoung.json | 24 +++ .../shouldSendAcceptedVerification.groovy | 33 +++ .../shouldSendRejectedVerification.groovy | 33 +++ .../rest/shouldGrantABeerIfOldEnough.groovy | 37 ++++ .../rest/shouldRejectABeerIfTooYoung.groovy | 37 ++++ .../rest/shouldGrantABeerIfOldEnough.json | 24 +++ .../rest/shouldRejectABeerIfTooYoung.json | 24 +++ .../shouldSendAcceptedVerification.groovy | 33 +++ .../shouldSendRejectedVerification.groovy | 33 +++ .../rest/shouldGrantABeerIfOldEnough.groovy | 37 ++++ .../rest/shouldRejectABeerIfTooYoung.groovy | 37 ++++ .../rest/shouldGrantABeerIfOldEnough.json | 24 +++ .../rest/shouldRejectABeerIfTooYoung.json | 24 +++ .../bazConsumer1/rest/shouldSayHello.groovy | 11 + .../bazConsumer1/rest/shouldSayHello.json | 12 ++ .../contract-predefined-names-git/README.adoc | 70 ++++++ .../git/COMMIT_EDITMSG | 1 + .../contract-predefined-names-git/git/HEAD | 1 + .../contract-predefined-names-git/git/config | 10 + .../git/description | 1 + .../git/hooks/applypatch-msg.sample | 15 ++ .../git/hooks/commit-msg.sample | 24 +++ .../git/hooks/post-update.sample | 8 + .../git/hooks/pre-applypatch.sample | 14 ++ .../git/hooks/pre-commit.sample | 49 +++++ .../git/hooks/pre-push.sample | 53 +++++ .../git/hooks/pre-rebase.sample | 169 +++++++++++++++ .../git/hooks/pre-receive.sample | 24 +++ .../git/hooks/prepare-commit-msg.sample | 36 ++++ .../git/hooks/update.sample | 128 +++++++++++ .../contract-predefined-names-git/git/index | Bin 0 -> 11127 bytes .../git/info/exclude | 6 + .../git/logs/HEAD | 3 + .../git/logs/refs/heads/master | 3 + .../git/logs/refs/remotes/origin/HEAD | 1 + .../1e/c084220c52398ce8cd2f8235018019504030f2 | Bin 0 -> 67 bytes .../2b/42d52aec21936e5578be5ea0e2fdb9c539ce88 | Bin 0 -> 84 bytes .../3b/d42890d5105a30abd82d0205b63cbf20a59e83 | 1 + .../3d/4a9b398121c61313558bd84a37637267539b25 | Bin 0 -> 67 bytes .../51/326f92638a0342965bc511cbcc2eab61b41050 | Bin 0 -> 166 bytes .../83/1a7e732650ab7428f60d51ba7d9ea33c51cf26 | Bin 0 -> 88 bytes .../8d/d4290a6ccef367cde77cf95ec7449dca23d6bb | Bin 0 -> 84 bytes .../b4/fc3812c95e3f5eed2ac1964a131464293786aa | Bin 0 -> 127 bytes .../c7/e616f78096e2d77a0d908464bce9d415505961 | Bin 0 -> 127 bytes .../f5/f3b2ddf93a179e1a0a93ccbf582d1e80648ce6 | Bin 0 -> 106 bytes ...eb4e6b44a393bca412489cd42ac7cc572b42d3.idx | Bin 0 -> 1968 bytes ...b4e6b44a393bca412489cd42ac7cc572b42d3.pack | Bin 0 -> 8048 bytes .../git/packed-refs | 2 + .../git/refs/heads/master | 1 + .../git/refs/remotes/origin/HEAD | 1 + 120 files changed, 3170 insertions(+), 23 deletions(-) create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/objects/1e/c084220c52398ce8cd2f8235018019504030f2 create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/objects/2b/42d52aec21936e5578be5ea0e2fdb9c539ce88 create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/objects/3b/d42890d5105a30abd82d0205b63cbf20a59e83 create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/objects/83/1a7e732650ab7428f60d51ba7d9ea33c51cf26 create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/objects/b4/fc3812c95e3f5eed2ac1964a131464293786aa create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/LICENSE.txt create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/0.0.1-SNAPSHOT/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/0.0.1-SNAPSHOT/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/0.0.1-SNAPSHOT/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/0.0.1-SNAPSHOT/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/0.0.1-SNAPSHOT/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/0.0.1-SNAPSHOT/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/latest/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/latest/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/latest/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/latest/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/latest/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/latest/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/release/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/release/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/release/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/release/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/release/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/com.example/beer-api-producer-external/release/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/foo.bar/bazService/0.0.1-SNAPSHOT/contracts/bazConsumer1/rest/shouldSayHello.groovy create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/META-INF/foo.bar/bazService/0.0.1-SNAPSHOT/mappings/bazConsumer1/rest/shouldSayHello.json create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/README.adoc create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/COMMIT_EDITMSG create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/HEAD create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/config create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/description create mode 100755 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/applypatch-msg.sample create mode 100755 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/commit-msg.sample create mode 100755 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/post-update.sample create mode 100755 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-applypatch.sample create mode 100755 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-commit.sample create mode 100755 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-push.sample create mode 100755 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-rebase.sample create mode 100755 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-receive.sample create mode 100755 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/prepare-commit-msg.sample create mode 100755 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/update.sample create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/index create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/info/exclude create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/logs/HEAD create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/logs/refs/heads/master create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/logs/refs/remotes/origin/HEAD create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/1e/c084220c52398ce8cd2f8235018019504030f2 create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/2b/42d52aec21936e5578be5ea0e2fdb9c539ce88 create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/3b/d42890d5105a30abd82d0205b63cbf20a59e83 create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/3d/4a9b398121c61313558bd84a37637267539b25 create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/51/326f92638a0342965bc511cbcc2eab61b41050 create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/83/1a7e732650ab7428f60d51ba7d9ea33c51cf26 create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/8d/d4290a6ccef367cde77cf95ec7449dca23d6bb create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/b4/fc3812c95e3f5eed2ac1964a131464293786aa create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/c7/e616f78096e2d77a0d908464bce9d415505961 create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/f5/f3b2ddf93a179e1a0a93ccbf582d1e80648ce6 create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/pack/pack-36eb4e6b44a393bca412489cd42ac7cc572b42d3.idx create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/pack/pack-36eb4e6b44a393bca412489cd42ac7cc572b42d3.pack create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/packed-refs create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/refs/heads/master create mode 100644 spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/refs/remotes/origin/HEAD diff --git a/docs/src/main/asciidoc/verifier_faq.adoc b/docs/src/main/asciidoc/verifier_faq.adoc index 6a3c15cd8b..0e0fff5c8b 100644 --- a/docs/src/main/asciidoc/verifier_faq.adoc +++ b/docs/src/main/asciidoc/verifier_faq.adoc @@ -503,7 +503,14 @@ Under `META-INF` folder: * we group applications via `groupId` (e.g. `com.example`) * then each application is represented via the `artifactId` (e.g. `beer-api-producer-git`) -* next, the version of the application. The version is mandatory! (e.g. `0.0.1-SNAPSHOT`) +* next, the version of the application (e.g. `0.0.1-SNAPSHOT`). Starting from Spring Cloud Contract version `2.1.0`, you can specify the versions as follows (assuming that your versions follow the semantic versioning) +** `+` or `latest` - to find the latest version of your stubs (assuming that the snapshots are always the latest artifact for a given revision number). That means: +*** if you have a version `1.0.0.RELEASE`, `2.0.0.BUILD-SNAPSHOT` and `2.0.0.RELEASE` we will assume that the latest is `2.0.0.BUILD-SNAPSHOT` +*** if you have a version `1.0.0.RELEASE` and `2.0.0.RELEASE` we will assume that the latest is `2.0.0.RELEASE` +*** if you have a version called `latest` or `+` we will pick that folder +** `release` - to find the latest release version of your stubs. That means: +*** if you have a version `1.0.0.RELEASE`, `2.0.0.BUILD-SNAPSHOT` and `2.0.0.RELEASE` we will assume that the latest is `2.0.0.RELEASE` +*** if you have a version called `release` we will pick that folder * finally, there are two folders: ** `contracts` - the good practice is to store the contracts required by each consumer in the folder with the consumer name (e.g. `beer-api-consumer`). That way you diff --git a/pom.xml b/pom.xml index e0b5b4e547..05ee603ba6 100644 --- a/pom.xml +++ b/pom.xml @@ -370,6 +370,11 @@ maven-aether-provider ${maven.version} + + org.apache.maven + maven-artifact + ${maven.version} + org.apache.maven maven-settings-builder diff --git a/spring-cloud-contract-shade/pom.xml b/spring-cloud-contract-shade/pom.xml index 90992cd8fd..7e28e3139b 100644 --- a/spring-cloud-contract-shade/pom.xml +++ b/spring-cloud-contract-shade/pom.xml @@ -52,6 +52,11 @@ maven-aether-provider true + + org.apache.maven + maven-artifact + true + org.apache.maven maven-settings-builder diff --git a/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/ScmStubDownloaderBuilder.java b/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/ScmStubDownloaderBuilder.java index e1425ef665..be9c73fd21 100644 --- a/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/ScmStubDownloaderBuilder.java +++ b/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/ScmStubDownloaderBuilder.java @@ -28,13 +28,18 @@ import java.nio.file.PathMatcher; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; import java.util.AbstractMap; +import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import shaded.org.apache.maven.artifact.versioning.DefaultArtifactVersion; + import org.springframework.cloud.contract.stubrunner.spring.StubRunnerProperties; import org.springframework.core.io.AbstractResource; import org.springframework.core.io.Resource; @@ -177,11 +182,6 @@ class GitStubDownloader implements StubDownloader { @Override public Map.Entry downloadAndUnpackStubJar( StubConfiguration stubConfiguration) { - if (StringUtils.isEmpty(stubConfiguration.version) - || "+".equals(stubConfiguration.version)) { - throw new IllegalStateException("Concrete version wasn't passed for [" - + stubConfiguration.toColonSeparatedDependencyNotation() + "]"); - } try { if (log.isDebugEnabled()) { log.debug("Trying to find a contract for [" @@ -278,13 +278,25 @@ class GitStubDownloaderProperties { class FileWalker extends SimpleFileVisitor { + private static final Log log = LogFactory.getLog(FileWalker.class); + + private static final List LATEST = Arrays.asList("latest", "+"); + private static final String RELEASE = "release"; + private final PathMatcher matcherWithDot; private final PathMatcher matcherWithoutDot; Path foundFile; + private final boolean latestSnapshotVersion; + + private final boolean latestReleaseVersion; + FileWalker(StubConfiguration stubConfiguration) { + this.latestSnapshotVersion = LATEST.stream().anyMatch( + s -> s.equals(stubConfiguration.version.toLowerCase())); + this.latestReleaseVersion = RELEASE.equals(stubConfiguration.version.toLowerCase()); this.matcherWithDot = FileSystems.getDefault() .getPathMatcher("glob:" + matcherGlob(stubConfiguration, ".")); this.matcherWithoutDot = FileSystems.getDefault() @@ -294,7 +306,8 @@ class FileWalker extends SimpleFileVisitor { private String matcherGlob(StubConfiguration stubConfiguration, String groupArtifactSeparator) { return "**" + stubConfiguration.groupId + groupArtifactSeparator - + stubConfiguration.artifactId + "/" + stubConfiguration.version; + + stubConfiguration.artifactId + "/" + (this.latestSnapshotVersion || + this.latestReleaseVersion ? "**" : stubConfiguration.version); } @Override @@ -302,10 +315,104 @@ class FileWalker extends SimpleFileVisitor { throws IOException { if (this.matcherWithDot.matches(dir.toAbsolutePath()) || this.matcherWithoutDot.matches(dir.toAbsolutePath())) { - this.foundFile = dir; + if (this.latestSnapshotVersion || this.latestReleaseVersion) { + // folders with name latest, release + File[] files = Objects.requireNonNull(dir.getParent().toFile() + .listFiles(File::isDirectory)); + File file = folderWithPredefinedName(files); + if (file != null) { + if (log.isDebugEnabled()) { + log.debug("Found folder with name corresponding to a latest version [" + file + "] "); + this.foundFile = file.toPath(); + return FileVisitResult.TERMINATE; + } + } + return latestVersionFromFolders(dir, files); + } else { + this.foundFile = dir; + } return FileVisitResult.TERMINATE; } return FileVisitResult.CONTINUE; } + private FileVisitResult latestVersionFromFolders(Path dir, File[] files) { + List versions = pickLatestVersion(files); + if (versions.isEmpty()) { + if (log.isDebugEnabled()) { + log.debug("Not a single version matching semver for path [" + dir.toAbsolutePath().toString() + "] was found"); + } + return FileVisitResult.CONTINUE; + } + // 2.0.0.RELEASE, 2.0.0.BUILD-SNAPSHOT + // 2.0.0.RELEASE + DefaultArtifactVersionWrapper latestFoundVersion = versions.get(versions.size() - 1); + latestFoundVersion = replaceWithSnapshotIfSameVersions(versions, latestFoundVersion); + this.foundFile = latestFoundVersion.file.toPath(); + return FileVisitResult.TERMINATE; + } + + private DefaultArtifactVersionWrapper replaceWithSnapshotIfSameVersions(List versions, DefaultArtifactVersionWrapper latestFoundVersion) { + if (versions.size() > 1 && this.latestSnapshotVersion) { + // 2.0.0.BUILD-SNAPSHOT + DefaultArtifactVersionWrapper versionWrapper = versions.get(versions.size() - 2); + // 2.0.0 vs 2.0.0 + boolean sameVersionsWithoutClassifier = Objects.equals(withoutClassifier(versionWrapper), withoutClassifier(latestFoundVersion)); + // replace the RELEASE one with SNAPSHOT + latestFoundVersion = sameVersionsWithoutClassifier && versionWrapper.isSnapshot() ? versionWrapper : latestFoundVersion; + } + return latestFoundVersion; + } + + private String withoutClassifier(DefaultArtifactVersionWrapper versionWrapper) { + String version = versionWrapper.version.toString(); + return version.substring(0, version.lastIndexOf(".")); + } + + private File folderWithPredefinedName(File[] files) { + if (this.latestSnapshotVersion) { + return Arrays.stream(files) + .filter(file -> LATEST.stream() + .anyMatch(s -> s.equals(file.getName().toLowerCase()))) + .findFirst().orElse(null); + } + return Arrays.stream(files) + .filter(file -> RELEASE.equals(file.getName().toLowerCase())) + .findFirst().orElse(null); + } + + private List pickLatestVersion(File[] files) { + return Arrays.stream(files) + .map(DefaultArtifactVersionWrapper::new) + .filter(wrapper -> this.latestSnapshotVersion || wrapper + .isNotSnapshot()) + .sorted() + .collect(Collectors.toList()); + } + +} + +class DefaultArtifactVersionWrapper implements Comparable { + private static final String SNAPSHOT_SUBSTRING = "snapshot"; + + final DefaultArtifactVersion version; + final File file; + + DefaultArtifactVersionWrapper(File file) { + this.version = new DefaultArtifactVersion(file.getName()); + this.file = file; + } + + boolean isSnapshot() { + return this.version.toString().toLowerCase().contains(SNAPSHOT_SUBSTRING); + } + + boolean isNotSnapshot() { + return !isSnapshot(); + } + + @Override + public int compareTo(DefaultArtifactVersionWrapper o) { + return this.version.compareTo(o.version); + } } \ No newline at end of file diff --git a/spring-cloud-contract-stub-runner/src/test/java/org/springframework/cloud/contract/stubrunner/GitStubDownloaderTests.java b/spring-cloud-contract-stub-runner/src/test/java/org/springframework/cloud/contract/stubrunner/GitStubDownloaderTests.java index 277480af1b..54a0e7961d 100644 --- a/spring-cloud-contract-stub-runner/src/test/java/org/springframework/cloud/contract/stubrunner/GitStubDownloaderTests.java +++ b/spring-cloud-contract-stub-runner/src/test/java/org/springframework/cloud/contract/stubrunner/GitStubDownloaderTests.java @@ -102,24 +102,131 @@ public class GitStubDownloaderTests { } @Test - public void should_fail_to_fetch_stubs_when_latest_version_was_specified() + public void should_pick_latest_build_snapshot_stubs_when_latest_version_set() throws URISyntaxException { StubDownloaderBuilder stubDownloaderBuilder = new ScmStubDownloaderBuilder(); StubDownloader stubDownloader = stubDownloaderBuilder .build(new StubRunnerOptionsBuilder() .withStubsMode(StubRunnerProperties.StubsMode.REMOTE) .withStubRepositoryRoot("git://" - + file("/git_samples/contract-git").getAbsolutePath()) + + file("/git_samples/contract-git/").getAbsolutePath() + "/") .withProperties(props()).build()); - try { - stubDownloader.downloadAndUnpackStubJar( - new StubConfiguration("foo.bar:bazService:+")); - } - catch (IllegalStateException e) { - then(e).hasMessageContaining( - "Concrete version wasn't passed for [foo.bar:bazService:+:stubs]"); - } + Map.Entry entry = stubDownloader + .downloadAndUnpackStubJar( + new StubConfiguration("com.example:beer-api-producer-external:+")); + + then(entry).isNotNull(); + then(entry.getValue().getAbsolutePath()).contains("com.example" + File.separator + + "beer-api-producer-external" + File.separator + "1.0.0.BUILD-SNAPSHOT"); + + entry = stubDownloader + .downloadAndUnpackStubJar( + new StubConfiguration("com.example:beer-api-producer-external:latest")); + + then(entry).isNotNull(); + then(entry.getValue().getAbsolutePath()).contains("com.example" + File.separator + + "beer-api-producer-external" + File.separator + "1.0.0.BUILD-SNAPSHOT"); + + entry = stubDownloader + .downloadAndUnpackStubJar( + new StubConfiguration("com.example:beer-api-producer-external:LATEST")); + + then(entry).isNotNull(); + then(entry.getValue().getAbsolutePath()).contains("com.example" + File.separator + + "beer-api-producer-external" + File.separator + "1.0.0.BUILD-SNAPSHOT"); + } + + @Test + public void should_pick_latest_release_stubs_when_release_version_set() + throws URISyntaxException { + StubDownloaderBuilder stubDownloaderBuilder = new ScmStubDownloaderBuilder(); + StubDownloader stubDownloader = stubDownloaderBuilder + .build(new StubRunnerOptionsBuilder() + .withStubsMode(StubRunnerProperties.StubsMode.REMOTE) + .withStubRepositoryRoot("git://" + + file("/git_samples/contract-git/").getAbsolutePath() + "/") + .withProperties(props()).build()); + + Map.Entry entry = stubDownloader + .downloadAndUnpackStubJar( + new StubConfiguration("com.example:beer-api-producer-external:release")); + + then(entry).isNotNull(); + then(entry.getValue().getAbsolutePath()).contains("com.example" + File.separator + + "beer-api-producer-external" + File.separator + "1.0.0.RELEASE"); + + entry = stubDownloader + .downloadAndUnpackStubJar( + new StubConfiguration("com.example:beer-api-producer-external:RELEASE")); + + then(entry).isNotNull(); + then(entry.getValue().getAbsolutePath()).contains("com.example" + File.separator + + "beer-api-producer-external" + File.separator + "1.0.0.RELEASE"); + } + + @Test + public void should_pick_latest_build_snapshot_stubs_when_latest_version_set_and_latest_folder_exists() + throws URISyntaxException { + StubDownloaderBuilder stubDownloaderBuilder = new ScmStubDownloaderBuilder(); + StubDownloader stubDownloader = stubDownloaderBuilder + .build(new StubRunnerOptionsBuilder() + .withStubsMode(StubRunnerProperties.StubsMode.REMOTE) + .withStubRepositoryRoot("git://" + + file("/git_samples/contract-predefined-names-git/").getAbsolutePath() + "/") + .withProperties(props()).build()); + + Map.Entry entry = stubDownloader + .downloadAndUnpackStubJar( + new StubConfiguration("com.example:beer-api-producer-external:+")); + + then(entry).isNotNull(); + then(entry.getValue().getAbsolutePath()).contains("com.example" + File.separator + + "beer-api-producer-external" + File.separator + "latest"); + + entry = stubDownloader + .downloadAndUnpackStubJar( + new StubConfiguration("com.example:beer-api-producer-external:latest")); + + then(entry).isNotNull(); + then(entry.getValue().getAbsolutePath()).contains("com.example" + File.separator + + "beer-api-producer-external" + File.separator + "latest"); + + entry = stubDownloader + .downloadAndUnpackStubJar( + new StubConfiguration("com.example:beer-api-producer-external:LATEST")); + + then(entry).isNotNull(); + then(entry.getValue().getAbsolutePath()).contains("com.example" + File.separator + + "beer-api-producer-external" + File.separator + "latest"); + } + + @Test + public void should_pick_release_folder_when_release_version_set() + throws URISyntaxException { + StubDownloaderBuilder stubDownloaderBuilder = new ScmStubDownloaderBuilder(); + StubDownloader stubDownloader = stubDownloaderBuilder + .build(new StubRunnerOptionsBuilder() + .withStubsMode(StubRunnerProperties.StubsMode.REMOTE) + .withStubRepositoryRoot("git://" + + file("/git_samples/contract-predefined-names-git/").getAbsolutePath() + "/") + .withProperties(props()).build()); + + Map.Entry entry = stubDownloader + .downloadAndUnpackStubJar( + new StubConfiguration("com.example:beer-api-producer-external:release")); + + then(entry).isNotNull(); + then(entry.getValue().getAbsolutePath()).contains("com.example" + File.separator + + "beer-api-producer-external" + File.separator + "release"); + + entry = stubDownloader + .downloadAndUnpackStubJar( + new StubConfiguration("com.example:beer-api-producer-external:RELEASE")); + + then(entry).isNotNull(); + then(entry.getValue().getAbsolutePath()).contains("com.example" + File.separator + + "beer-api-producer-external" + File.separator + "release"); } @Test @@ -130,7 +237,8 @@ public class GitStubDownloaderTests { .build(new StubRunnerOptionsBuilder() .withStubsMode(StubRunnerProperties.StubsMode.REMOTE) .withStubRepositoryRoot("git://" - + file("/git_samples/contract-git").getAbsolutePath()) + + file("/git_samples/contract-git").getAbsolutePath() + + "/") .withProperties(props()).build()); try { diff --git a/spring-cloud-contract-stub-runner/src/test/java/org/springframework/cloud/contract/stubrunner/TestUtils.java b/spring-cloud-contract-stub-runner/src/test/java/org/springframework/cloud/contract/stubrunner/TestUtils.java index c65c27f7ab..b0a24b2791 100644 --- a/spring-cloud-contract-stub-runner/src/test/java/org/springframework/cloud/contract/stubrunner/TestUtils.java +++ b/spring-cloud-contract-stub-runner/src/test/java/org/springframework/cloud/contract/stubrunner/TestUtils.java @@ -25,6 +25,7 @@ class TestUtils { public static void prepareLocalRepo() throws IOException { prepareLocalRepo("target/test-classes/git_samples/", "contract-git"); + prepareLocalRepo("target/test-classes/git_samples/", "contract-predefined-names-git"); } private static void prepareLocalRepo(String buildDir, String repoPath) diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy new file mode 100644 index 0000000000..247c62bae9 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy @@ -0,0 +1,33 @@ +package contracts.beer.messaging + +org.springframework.cloud.contract.spec.Contract.make { + description(""" +Sends a positive verification message when person is eligible to get the beer + +``` +given: + client is old enough +when: + he applies for a beer +then: + we'll send a message with a positive verification +``` + +""") + // Label by means of which the output message can be triggered + label 'accepted_verification' + // input to the contract + input { + // the contract will be triggered by a method + triggeredBy('clientIsOldEnough()') + } + // output message of the contract + outputMessage { + // destination to which the output message will be sent + sentTo 'verifications' + // the body of the output message + body([ + eligible: true + ]) + } +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy new file mode 100644 index 0000000000..514f244883 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy @@ -0,0 +1,33 @@ +package contracts.beer.messaging + +org.springframework.cloud.contract.spec.Contract.make { + description(""" +Sends a negative verification message when person is not eligible to get the beer + +``` +given: + client is too young +when: + he applies for a beer +then: + we'll send a message with a negative verification +``` + +""") + // Label by means of which the output message can be triggered + label 'rejected_verification' + // input to the contract + input { + // the contract will be triggered by a method + triggeredBy('clientIsTooYoung()') + } + // output message of the contract + outputMessage { + // destination to which the output message will be sent + sentTo 'verifications' + // the body of the output message + body([ + eligible: false + ]) + } +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy new file mode 100644 index 0000000000..3e71c00ed5 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy @@ -0,0 +1,37 @@ +package contracts.beer.rest + +org.springframework.cloud.contract.spec.Contract.make { + request { + description(""" +Represents a successful scenario of getting a beer + +given: + client is old enough +when: + he applies for a beer +then: + we'll grant him the beer +""") + method 'POST' + url '/check' + body( + age: value(consumer(regex('[2-9][0-9]'))) + ) + headers { + header 'Content-Type', 'application/json' + } + } + response { + status 200 + body( """ + { + "status": "OK" + } + """) + headers { + header( + 'Content-Type', value(consumer('application/json'),producer(regex('application/json.*'))) + ) + } + } +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy new file mode 100644 index 0000000000..ef84a9a58e --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy @@ -0,0 +1,37 @@ +package contracts.beer.rest + +org.springframework.cloud.contract.spec.Contract.make { + request { + description(""" +Represents a unsuccessful scenario of getting a beer + +given: + client is not old enough +when: + he applies for a beer +then: + we'll NOT grant him the beer +""") + method 'POST' + url '/check' + body( + age: value(consumer(regex('[0-1][0-9]'))) + ) + headers { + header 'Content-Type', 'application/json' + } + } + response { + status 200 + body( """ + { + "status": "NOT_OK" + } + """) + headers { + header( + 'Content-Type', value(consumer('application/json'),producer(regex('application/json.*'))) + ) + } + } +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json new file mode 100644 index 0000000000..4e627786fd --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json @@ -0,0 +1,24 @@ +{ + "id" : "e5413ef6-0f3e-4b81-9e78-7a90b53c6ed1", + "request" : { + "url" : "/check", + "method" : "POST", + "headers" : { + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "matchesJsonPath" : "$[?(@.['age'] =~ /[2-9][0-9]/)]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\"status\":\"OK\"}", + "headers" : { + "Content-Type" : "application/json" + }, + "transformers" : [ "response-template" ] + }, + "uuid" : "e5413ef6-0f3e-4b81-9e78-7a90b53c6ed1" +} \ No newline at end of file diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json new file mode 100644 index 0000000000..932477d065 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.BUILD-SNAPSHOT/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json @@ -0,0 +1,24 @@ +{ + "id" : "b54426aa-b2ef-4b12-adc9-a05fcf6a4e08", + "request" : { + "url" : "/check", + "method" : "POST", + "headers" : { + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "matchesJsonPath" : "$[?(@.['age'] =~ /[0-1][0-9]/)]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\"status\":\"NOT_OK\"}", + "headers" : { + "Content-Type" : "application/json" + }, + "transformers" : [ "response-template" ] + }, + "uuid" : "b54426aa-b2ef-4b12-adc9-a05fcf6a4e08" +} \ No newline at end of file diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy new file mode 100644 index 0000000000..247c62bae9 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy @@ -0,0 +1,33 @@ +package contracts.beer.messaging + +org.springframework.cloud.contract.spec.Contract.make { + description(""" +Sends a positive verification message when person is eligible to get the beer + +``` +given: + client is old enough +when: + he applies for a beer +then: + we'll send a message with a positive verification +``` + +""") + // Label by means of which the output message can be triggered + label 'accepted_verification' + // input to the contract + input { + // the contract will be triggered by a method + triggeredBy('clientIsOldEnough()') + } + // output message of the contract + outputMessage { + // destination to which the output message will be sent + sentTo 'verifications' + // the body of the output message + body([ + eligible: true + ]) + } +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy new file mode 100644 index 0000000000..514f244883 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy @@ -0,0 +1,33 @@ +package contracts.beer.messaging + +org.springframework.cloud.contract.spec.Contract.make { + description(""" +Sends a negative verification message when person is not eligible to get the beer + +``` +given: + client is too young +when: + he applies for a beer +then: + we'll send a message with a negative verification +``` + +""") + // Label by means of which the output message can be triggered + label 'rejected_verification' + // input to the contract + input { + // the contract will be triggered by a method + triggeredBy('clientIsTooYoung()') + } + // output message of the contract + outputMessage { + // destination to which the output message will be sent + sentTo 'verifications' + // the body of the output message + body([ + eligible: false + ]) + } +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy new file mode 100644 index 0000000000..3e71c00ed5 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy @@ -0,0 +1,37 @@ +package contracts.beer.rest + +org.springframework.cloud.contract.spec.Contract.make { + request { + description(""" +Represents a successful scenario of getting a beer + +given: + client is old enough +when: + he applies for a beer +then: + we'll grant him the beer +""") + method 'POST' + url '/check' + body( + age: value(consumer(regex('[2-9][0-9]'))) + ) + headers { + header 'Content-Type', 'application/json' + } + } + response { + status 200 + body( """ + { + "status": "OK" + } + """) + headers { + header( + 'Content-Type', value(consumer('application/json'),producer(regex('application/json.*'))) + ) + } + } +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy new file mode 100644 index 0000000000..ef84a9a58e --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy @@ -0,0 +1,37 @@ +package contracts.beer.rest + +org.springframework.cloud.contract.spec.Contract.make { + request { + description(""" +Represents a unsuccessful scenario of getting a beer + +given: + client is not old enough +when: + he applies for a beer +then: + we'll NOT grant him the beer +""") + method 'POST' + url '/check' + body( + age: value(consumer(regex('[0-1][0-9]'))) + ) + headers { + header 'Content-Type', 'application/json' + } + } + response { + status 200 + body( """ + { + "status": "NOT_OK" + } + """) + headers { + header( + 'Content-Type', value(consumer('application/json'),producer(regex('application/json.*'))) + ) + } + } +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json new file mode 100644 index 0000000000..4e627786fd --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json @@ -0,0 +1,24 @@ +{ + "id" : "e5413ef6-0f3e-4b81-9e78-7a90b53c6ed1", + "request" : { + "url" : "/check", + "method" : "POST", + "headers" : { + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "matchesJsonPath" : "$[?(@.['age'] =~ /[2-9][0-9]/)]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\"status\":\"OK\"}", + "headers" : { + "Content-Type" : "application/json" + }, + "transformers" : [ "response-template" ] + }, + "uuid" : "e5413ef6-0f3e-4b81-9e78-7a90b53c6ed1" +} \ No newline at end of file diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json new file mode 100644 index 0000000000..932477d065 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.M1/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json @@ -0,0 +1,24 @@ +{ + "id" : "b54426aa-b2ef-4b12-adc9-a05fcf6a4e08", + "request" : { + "url" : "/check", + "method" : "POST", + "headers" : { + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "matchesJsonPath" : "$[?(@.['age'] =~ /[0-1][0-9]/)]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\"status\":\"NOT_OK\"}", + "headers" : { + "Content-Type" : "application/json" + }, + "transformers" : [ "response-template" ] + }, + "uuid" : "b54426aa-b2ef-4b12-adc9-a05fcf6a4e08" +} \ No newline at end of file diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy new file mode 100644 index 0000000000..247c62bae9 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy @@ -0,0 +1,33 @@ +package contracts.beer.messaging + +org.springframework.cloud.contract.spec.Contract.make { + description(""" +Sends a positive verification message when person is eligible to get the beer + +``` +given: + client is old enough +when: + he applies for a beer +then: + we'll send a message with a positive verification +``` + +""") + // Label by means of which the output message can be triggered + label 'accepted_verification' + // input to the contract + input { + // the contract will be triggered by a method + triggeredBy('clientIsOldEnough()') + } + // output message of the contract + outputMessage { + // destination to which the output message will be sent + sentTo 'verifications' + // the body of the output message + body([ + eligible: true + ]) + } +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy new file mode 100644 index 0000000000..514f244883 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy @@ -0,0 +1,33 @@ +package contracts.beer.messaging + +org.springframework.cloud.contract.spec.Contract.make { + description(""" +Sends a negative verification message when person is not eligible to get the beer + +``` +given: + client is too young +when: + he applies for a beer +then: + we'll send a message with a negative verification +``` + +""") + // Label by means of which the output message can be triggered + label 'rejected_verification' + // input to the contract + input { + // the contract will be triggered by a method + triggeredBy('clientIsTooYoung()') + } + // output message of the contract + outputMessage { + // destination to which the output message will be sent + sentTo 'verifications' + // the body of the output message + body([ + eligible: false + ]) + } +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy new file mode 100644 index 0000000000..3e71c00ed5 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy @@ -0,0 +1,37 @@ +package contracts.beer.rest + +org.springframework.cloud.contract.spec.Contract.make { + request { + description(""" +Represents a successful scenario of getting a beer + +given: + client is old enough +when: + he applies for a beer +then: + we'll grant him the beer +""") + method 'POST' + url '/check' + body( + age: value(consumer(regex('[2-9][0-9]'))) + ) + headers { + header 'Content-Type', 'application/json' + } + } + response { + status 200 + body( """ + { + "status": "OK" + } + """) + headers { + header( + 'Content-Type', value(consumer('application/json'),producer(regex('application/json.*'))) + ) + } + } +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy new file mode 100644 index 0000000000..ef84a9a58e --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy @@ -0,0 +1,37 @@ +package contracts.beer.rest + +org.springframework.cloud.contract.spec.Contract.make { + request { + description(""" +Represents a unsuccessful scenario of getting a beer + +given: + client is not old enough +when: + he applies for a beer +then: + we'll NOT grant him the beer +""") + method 'POST' + url '/check' + body( + age: value(consumer(regex('[0-1][0-9]'))) + ) + headers { + header 'Content-Type', 'application/json' + } + } + response { + status 200 + body( """ + { + "status": "NOT_OK" + } + """) + headers { + header( + 'Content-Type', value(consumer('application/json'),producer(regex('application/json.*'))) + ) + } + } +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json new file mode 100644 index 0000000000..4e627786fd --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json @@ -0,0 +1,24 @@ +{ + "id" : "e5413ef6-0f3e-4b81-9e78-7a90b53c6ed1", + "request" : { + "url" : "/check", + "method" : "POST", + "headers" : { + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "matchesJsonPath" : "$[?(@.['age'] =~ /[2-9][0-9]/)]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\"status\":\"OK\"}", + "headers" : { + "Content-Type" : "application/json" + }, + "transformers" : [ "response-template" ] + }, + "uuid" : "e5413ef6-0f3e-4b81-9e78-7a90b53c6ed1" +} \ No newline at end of file diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json new file mode 100644 index 0000000000..932477d065 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RC1/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json @@ -0,0 +1,24 @@ +{ + "id" : "b54426aa-b2ef-4b12-adc9-a05fcf6a4e08", + "request" : { + "url" : "/check", + "method" : "POST", + "headers" : { + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "matchesJsonPath" : "$[?(@.['age'] =~ /[0-1][0-9]/)]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\"status\":\"NOT_OK\"}", + "headers" : { + "Content-Type" : "application/json" + }, + "transformers" : [ "response-template" ] + }, + "uuid" : "b54426aa-b2ef-4b12-adc9-a05fcf6a4e08" +} \ No newline at end of file diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy new file mode 100644 index 0000000000..247c62bae9 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/messaging/shouldSendAcceptedVerification.groovy @@ -0,0 +1,33 @@ +package contracts.beer.messaging + +org.springframework.cloud.contract.spec.Contract.make { + description(""" +Sends a positive verification message when person is eligible to get the beer + +``` +given: + client is old enough +when: + he applies for a beer +then: + we'll send a message with a positive verification +``` + +""") + // Label by means of which the output message can be triggered + label 'accepted_verification' + // input to the contract + input { + // the contract will be triggered by a method + triggeredBy('clientIsOldEnough()') + } + // output message of the contract + outputMessage { + // destination to which the output message will be sent + sentTo 'verifications' + // the body of the output message + body([ + eligible: true + ]) + } +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy new file mode 100644 index 0000000000..514f244883 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/messaging/shouldSendRejectedVerification.groovy @@ -0,0 +1,33 @@ +package contracts.beer.messaging + +org.springframework.cloud.contract.spec.Contract.make { + description(""" +Sends a negative verification message when person is not eligible to get the beer + +``` +given: + client is too young +when: + he applies for a beer +then: + we'll send a message with a negative verification +``` + +""") + // Label by means of which the output message can be triggered + label 'rejected_verification' + // input to the contract + input { + // the contract will be triggered by a method + triggeredBy('clientIsTooYoung()') + } + // output message of the contract + outputMessage { + // destination to which the output message will be sent + sentTo 'verifications' + // the body of the output message + body([ + eligible: false + ]) + } +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy new file mode 100644 index 0000000000..3e71c00ed5 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.groovy @@ -0,0 +1,37 @@ +package contracts.beer.rest + +org.springframework.cloud.contract.spec.Contract.make { + request { + description(""" +Represents a successful scenario of getting a beer + +given: + client is old enough +when: + he applies for a beer +then: + we'll grant him the beer +""") + method 'POST' + url '/check' + body( + age: value(consumer(regex('[2-9][0-9]'))) + ) + headers { + header 'Content-Type', 'application/json' + } + } + response { + status 200 + body( """ + { + "status": "OK" + } + """) + headers { + header( + 'Content-Type', value(consumer('application/json'),producer(regex('application/json.*'))) + ) + } + } +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy new file mode 100644 index 0000000000..ef84a9a58e --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/contracts/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.groovy @@ -0,0 +1,37 @@ +package contracts.beer.rest + +org.springframework.cloud.contract.spec.Contract.make { + request { + description(""" +Represents a unsuccessful scenario of getting a beer + +given: + client is not old enough +when: + he applies for a beer +then: + we'll NOT grant him the beer +""") + method 'POST' + url '/check' + body( + age: value(consumer(regex('[0-1][0-9]'))) + ) + headers { + header 'Content-Type', 'application/json' + } + } + response { + status 200 + body( """ + { + "status": "NOT_OK" + } + """) + headers { + header( + 'Content-Type', value(consumer('application/json'),producer(regex('application/json.*'))) + ) + } + } +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json new file mode 100644 index 0000000000..4e627786fd --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/mappings/beer-api-consumer/rest/shouldGrantABeerIfOldEnough.json @@ -0,0 +1,24 @@ +{ + "id" : "e5413ef6-0f3e-4b81-9e78-7a90b53c6ed1", + "request" : { + "url" : "/check", + "method" : "POST", + "headers" : { + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "matchesJsonPath" : "$[?(@.['age'] =~ /[2-9][0-9]/)]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\"status\":\"OK\"}", + "headers" : { + "Content-Type" : "application/json" + }, + "transformers" : [ "response-template" ] + }, + "uuid" : "e5413ef6-0f3e-4b81-9e78-7a90b53c6ed1" +} \ No newline at end of file diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json new file mode 100644 index 0000000000..932477d065 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/META-INF/com.example/beer-api-producer-external/1.0.0.RELEASE/mappings/beer-api-consumer/rest/shouldRejectABeerIfTooYoung.json @@ -0,0 +1,24 @@ +{ + "id" : "b54426aa-b2ef-4b12-adc9-a05fcf6a4e08", + "request" : { + "url" : "/check", + "method" : "POST", + "headers" : { + "Content-Type" : { + "equalTo" : "application/json" + } + }, + "bodyPatterns" : [ { + "matchesJsonPath" : "$[?(@.['age'] =~ /[0-1][0-9]/)]" + } ] + }, + "response" : { + "status" : 200, + "body" : "{\"status\":\"NOT_OK\"}", + "headers" : { + "Content-Type" : "application/json" + }, + "transformers" : [ "response-template" ] + }, + "uuid" : "b54426aa-b2ef-4b12-adc9-a05fcf6a4e08" +} \ No newline at end of file diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/config b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/config index 15061e6c76..1bc26be514 100644 --- a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/config +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/config @@ -5,9 +5,6 @@ logallrefupdates = true ignorecase = true precomposeunicode = true -[remote "origin"] - url = git@github.com:marcingrzejszczak/contract-git.git - fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/index b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/index index 4977ad096821f5e02240f0ca04659bdd75b4709f..3eff85dae3cb6f3ff373a4c8b5c9fb5d0cc91ff5 100644 GIT binary patch literal 8274 zcmeI1c~BEq9LHC%N<*m@#1Taba#Vp_90JyAIRb<$kN^T=YzPZRlPqq6K#Fo!Q7Pb1 z6{prpD;+G9dQGRGRh(AA3iSY_o!Tm`TEJRQ)FNP)09kmvfC5SXVQ2COVRzs6`}@A% zCvV>KVskwa1koWr3!)eIxKjPRsL^&l_wDBxgi=pq+xn-3aQ`L5u z^VImRRr5zYr%dT`tQgrA$O?6*vV*+oLQFzKlLe9lF-ng?QJgAB5K$9wEH+U{{DCIR zQCunz(-|}djY;JNxd-!nIibW;QaLUV%4Os;#8 zW8H;9G(nEWhNHMBP9zk_MVOQpk7L+|ls-3V{a6Bi+Cn&1zF9dn>pIv5&3cI~Pa^%} zEwt{3i>^h5WAZ}<{D_yWuYSELS0et@cfoneJI80WSMAA1GBubFj>_cy(fHs3sodRz zh@BnB5y!HmSYrH|7t6&S@S(VyeXu02_{NpFc*$+f7KvZ!3|l>I`RI$I-$*EiMPiB4 z_>p{snezMk&+KEshgDEa(&p}GKi@W~xGnKNxj|sEmuilrjWZ94AR&S12w1y}8pm20 zCI$OlrQg~B(7&+ID(NB`c zZ2g%8uNX9sFm`~KhNwmG7v{$w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V6pXlxua>UO@(yV8 z*>g+yOvTiv+*KzQZ?=%MWt1=jYB%2+{;yMV_sl~{VlLD8Z`!4 1522062299 +0200 clone: from git@github.com:marcingrzejszczak/contract-git.git +0b36113e5fa9713025d50f046e8fd209fc8d9597 3bd42890d5105a30abd82d0205b63cbf20a59e83 Marcin Grzejszczak 1547107982 +0100 commit: Added more versions diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/logs/refs/heads/master b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/logs/refs/heads/master index 91006b3a8e..abed8dd31c 100644 --- a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/logs/refs/heads/master +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/logs/refs/heads/master @@ -1 +1,2 @@ 0000000000000000000000000000000000000000 0b36113e5fa9713025d50f046e8fd209fc8d9597 Marcin Grzejszczak 1522062299 +0200 clone: from git@github.com:marcingrzejszczak/contract-git.git +0b36113e5fa9713025d50f046e8fd209fc8d9597 3bd42890d5105a30abd82d0205b63cbf20a59e83 Marcin Grzejszczak 1547107982 +0100 commit: Added more versions diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/objects/1e/c084220c52398ce8cd2f8235018019504030f2 b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/objects/1e/c084220c52398ce8cd2f8235018019504030f2 new file mode 100644 index 0000000000000000000000000000000000000000..117868894b378b6e21a5ac640a9c9f6280059d95 GIT binary patch literal 67 zcmV-J0KETr0V^p=O;s>8W-u`T0)?d1)FR!)f=u0lqWqN7WFRNCq9nB_FENLqS*osB ZEnszt#y8%;UA6NT+XS9h0|08q77VU!9IF5T literal 0 HcmV?d00001 diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/objects/2b/42d52aec21936e5578be5ea0e2fdb9c539ce88 b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/objects/2b/42d52aec21936e5578be5ea0e2fdb9c539ce88 new file mode 100644 index 0000000000000000000000000000000000000000..91e89ac31180fd797d0d6093769f9dd318a26c5c GIT binary patch literal 84 zcmV-a0IUCa0V^p=O;s>AVlXiP0)^!KT)ota#N2|MR0g>NElNB=mOU@d>NlA(Hb@3I q7<_`LO3TmJOG+$aD6qMvn!G~$>XZE{@iXkwgdX!tJ_G<3WgG&k@FS@J literal 0 HcmV?d00001 diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/objects/3b/d42890d5105a30abd82d0205b63cbf20a59e83 b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/objects/3b/d42890d5105a30abd82d0205b63cbf20a59e83 new file mode 100644 index 0000000000..891584b4b4 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/objects/3b/d42890d5105a30abd82d0205b63cbf20a59e83 @@ -0,0 +1 @@ +x¥Î=N1@ajŸbúHhÆÿ–"D**1±Ç`’]G^“bO”& |ͧ—û²´ Úù—9Dàlk6‘tNNLu"Es¦ä-“!ë­N&DϬnElAYa$iG&CI&eZp~lt6)iKx=t62ai|3cQ1ha>9% literal 0 HcmV?d00001 diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/objects/b4/fc3812c95e3f5eed2ac1964a131464293786aa b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-git/git/objects/b4/fc3812c95e3f5eed2ac1964a131464293786aa new file mode 100644 index 0000000000000000000000000000000000000000..e74d64efc7ddda955c3c63774f6973e02ac09267 GIT binary patch literal 127 zcmV-_0D%8^0V^p=O;s>7G-fa~FfcPQQSk9}cJ&K()hnqeVYud+8CGmE&(i(H({)b9 zx?G3Fe6E`q0D*$9Ylx$+r=J^xw$oLuH;R+ + org.springframework.cloud + spring-cloud-contract-maven-plugin + + + true + + com.example + beer-contracts + + + +---- + +and for Gradle: + +[source,groovy] +---- +contracts { + contractsWorkOffline = true + contractDependency { + stringNotation = "com.example:beer-contracts" + } +} +---- diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/COMMIT_EDITMSG b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/COMMIT_EDITMSG new file mode 100644 index 0000000000..44b23e0481 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/COMMIT_EDITMSG @@ -0,0 +1 @@ +New names diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/HEAD b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/HEAD new file mode 100644 index 0000000000..cb089cd89a --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/config b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/config new file mode 100644 index 0000000000..1bc26be514 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/config @@ -0,0 +1,10 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true +[branch "master"] + remote = origin + merge = refs/heads/master diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/description b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/description new file mode 100644 index 0000000000..498b267a8c --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/applypatch-msg.sample b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/applypatch-msg.sample new file mode 100755 index 0000000000..a5d7b84a67 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/commit-msg.sample b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/commit-msg.sample new file mode 100755 index 0000000000..b58d1184a9 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/post-update.sample b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/post-update.sample new file mode 100755 index 0000000000..ec17ec1939 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-applypatch.sample b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-applypatch.sample new file mode 100755 index 0000000000..4142082bcb --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-commit.sample b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-commit.sample new file mode 100755 index 0000000000..68d62d5446 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-push.sample b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-push.sample new file mode 100755 index 0000000000..6187dbf439 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +z40=0000000000000000000000000000000000000000 + +while read local_ref local_sha remote_ref remote_sha +do + if [ "$local_sha" = $z40 ] + then + # Handle delete + : + else + if [ "$remote_sha" = $z40 ] + then + # New branch, examine all commits + range="$local_sha" + else + # Update to existing branch, examine new commits + range="$remote_sha..$local_sha" + fi + + # Check for WIP commit + commit=`git rev-list -n 1 --grep '^WIP' "$range"` + if [ -n "$commit" ] + then + echo >&2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-rebase.sample b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-rebase.sample new file mode 100755 index 0000000000..33730ca647 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up-to-date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +<<\DOC_END + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". + +DOC_END diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-receive.sample b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-receive.sample new file mode 100755 index 0000000000..a1fd29ec14 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/prepare-commit-msg.sample b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/prepare-commit-msg.sample new file mode 100755 index 0000000000..f093a02ec4 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/prepare-commit-msg.sample @@ -0,0 +1,36 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first comments out the +# "Conflicts:" part of a merge commit. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +case "$2,$3" in + merge,) + /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; + +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$1" ;; + + *) ;; +esac + +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/update.sample b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/update.sample new file mode 100755 index 0000000000..80ba94135c --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/hooks/update.sample @@ -0,0 +1,128 @@ +#!/bin/sh +# +# An example hook script to block unannotated tags from entering. +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new +# +# To enable this hook, rename this file to "update". +# +# Config +# ------ +# hooks.allowunannotated +# This boolean sets whether unannotated tags will be allowed into the +# repository. By default they won't be. +# hooks.allowdeletetag +# This boolean sets whether deleting tags will be allowed in the +# repository. By default they won't be. +# hooks.allowmodifytag +# This boolean sets whether a tag may be modified after creation. By default +# it won't be. +# hooks.allowdeletebranch +# This boolean sets whether deleting branches will be allowed in the +# repository. By default they won't be. +# hooks.denycreatebranch +# This boolean sets whether remotely creating branches will be denied +# in the repository. By default this is allowed. +# + +# --- Command line +refname="$1" +oldrev="$2" +newrev="$3" + +# --- Safety check +if [ -z "$GIT_DIR" ]; then + echo "Don't run this script from the command line." >&2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --bool hooks.allowunannotated) +allowdeletebranch=$(git config --bool hooks.allowdeletebranch) +denycreatebranch=$(git config --bool hooks.denycreatebranch) +allowdeletetag=$(git config --bool hooks.allowdeletetag) +allowmodifytag=$(git config --bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero="0000000000000000000000000000000000000000" +if [ "$newrev" = "$zero" ]; then + newrev_type=delete +else + newrev_type=$(git cat-file -t $newrev) +fi + +case "$refname","$newrev_type" in + refs/tags/*,commit) + # un-annotated tag + short_refname=${refname##refs/tags/} + if [ "$allowunannotated" != "true" ]; then + echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/index b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/index new file mode 100644 index 0000000000000000000000000000000000000000..1e5889eed8e31dee1093773a46c4f836b37a94a9 GIT binary patch literal 11127 zcmeI2c~BEq9LKk6tHx3lL@Fx9608U0peV&E$`K^tQUWN5I7_m`Xp+TEkfT`6R;vg& zR?&L2w$i~7ty)J#Y}K|SRH0hs&{3 z`|Qix_2GwjBM35xe6yn5=H)Y+#iOF8&wuRnrd1C4nLjdb+9m`^--{rF>)YQ>(bYU@ zxYBjE`~3Pl2ff~PX8brdpavNc!1v|_33)74qKZ6F{nDJz)34F+d}D?ho^Q}yW=hP- zhQq?*Fw-w{UFph3zD3Qj_}Zoj zf5{}X`w78TV4`06SpfKvd8|6~Mpd?4_PO8N7Z`I&#@s)-Jr~I^VSNZpsnV8aK7lG! zo?c|x`LV$=F;9WVOO|)9E-L^Z$q%#k73A!xtF|Qy9t5wI3kpY08)hya?d8xK3B~aU zJYFGz`4}?yPffpsO^7Dv9oc_Yselh=P)x$dtmf(u z;>eDGwM&=fSfRufx_&p-Uk&J=vYDB12@5>>H1fCPhE3t`jh>q0Fu_dv;brKk|HFkZ z4S8i-1?Y$KDzB&cb4gxtSYBcL03Q=kOT%AdKQ(|KIIsR6Kb=yG#?Ljt51d!)OkSTZ z+eCLYq49AY@B!zQS$)9U1?q$1mCZ%K2b@A&(+9j9 zT6$@H==e*m-$s+`xQ^>Ln)Oyz@9GiA?f;dQraz2*lmI^9+%lh!PFba1Gt&5I0erxD zm12^5bemE1`Yi(i{cuj1TtB=SbZpY;cPO1%XSkjknF#2I^C_v<`S+Pg2J?pE(P#mn z8_pwB>xRd!VUU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a9713025d50f046e8fd209fc8d9597 3bd42890d5105a30abd82d0205b63cbf20a59e83 Marcin Grzejszczak 1547107982 +0100 commit: Added more versions +3bd42890d5105a30abd82d0205b63cbf20a59e83 51326f92638a0342965bc511cbcc2eab61b41050 Marcin Grzejszczak 1547124882 +0100 commit: New names diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/logs/refs/heads/master b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/logs/refs/heads/master new file mode 100644 index 0000000000..d9a1c39de9 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/logs/refs/heads/master @@ -0,0 +1,3 @@ +0000000000000000000000000000000000000000 0b36113e5fa9713025d50f046e8fd209fc8d9597 Marcin Grzejszczak 1522062299 +0200 clone: from git@github.com:marcingrzejszczak/contract-git.git +0b36113e5fa9713025d50f046e8fd209fc8d9597 3bd42890d5105a30abd82d0205b63cbf20a59e83 Marcin Grzejszczak 1547107982 +0100 commit: Added more versions +3bd42890d5105a30abd82d0205b63cbf20a59e83 51326f92638a0342965bc511cbcc2eab61b41050 Marcin Grzejszczak 1547124882 +0100 commit: New names diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/logs/refs/remotes/origin/HEAD b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/logs/refs/remotes/origin/HEAD new file mode 100644 index 0000000000..91006b3a8e --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/logs/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 0b36113e5fa9713025d50f046e8fd209fc8d9597 Marcin Grzejszczak 1522062299 +0200 clone: from git@github.com:marcingrzejszczak/contract-git.git diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/1e/c084220c52398ce8cd2f8235018019504030f2 b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/1e/c084220c52398ce8cd2f8235018019504030f2 new file mode 100644 index 0000000000000000000000000000000000000000..117868894b378b6e21a5ac640a9c9f6280059d95 GIT binary patch literal 67 zcmV-J0KETr0V^p=O;s>8W-u`T0)?d1)FR!)f=u0lqWqN7WFRNCq9nB_FENLqS*osB ZEnszt#y8%;UA6NT+XS9h0|08q77VU!9IF5T literal 0 HcmV?d00001 diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/2b/42d52aec21936e5578be5ea0e2fdb9c539ce88 b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/2b/42d52aec21936e5578be5ea0e2fdb9c539ce88 new file mode 100644 index 0000000000000000000000000000000000000000..91e89ac31180fd797d0d6093769f9dd318a26c5c GIT binary patch literal 84 zcmV-a0IUCa0V^p=O;s>AVlXiP0)^!KT)ota#N2|MR0g>NElNB=mOU@d>NlA(Hb@3I q7<_`LO3TmJOG+$aD6qMvn!G~$>XZE{@iXkwgdX!tJ_G<3WgG&k@FS@J literal 0 HcmV?d00001 diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/3b/d42890d5105a30abd82d0205b63cbf20a59e83 b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/3b/d42890d5105a30abd82d0205b63cbf20a59e83 new file mode 100644 index 0000000000..891584b4b4 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/3b/d42890d5105a30abd82d0205b63cbf20a59e83 @@ -0,0 +1 @@ +x¥Î=N1@ajŸbúHhÆÿ–"D**1±Ç`’]G^“bO”& |ͧ—û²´ Úù—9Dàlk6‘tNNLu"Es¦ä-“!ë­N&DϬn8W-u`T0)?d1)FR!)f=u0lqWqN7WFRNCq9nB_FENMV>*q~( Ze_Dyplj53uW`BgPTtiCFGXRd47!A&)9u@!q literal 0 HcmV?d00001 diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/51/326f92638a0342965bc511cbcc2eab61b41050 b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/51/326f92638a0342965bc511cbcc2eab61b41050 new file mode 100644 index 0000000000000000000000000000000000000000..ef3caae7d1d111191803c8a2d9213cd9dbbb4133 GIT binary patch literal 166 zcmV;X09pTd0j1763IZ_@fMM&LVtPR)?*v5btn?0(WYksnK{hJv=>;1PVEH#6e;)h3 zYoLr)kys-Qxf zoX+X2kZk0j1wGq!tZ<~7y8#Y$;oH3Ah3>HJFTdJP-D_<0*mUC#q%~eD6M}*@N<@*r Uw~haG#EIW9P|vgY05Z)_hs2Ch!2kdN literal 0 HcmV?d00001 diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/83/1a7e732650ab7428f60d51ba7d9ea33c51cf26 b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/83/1a7e732650ab7428f60d51ba7d9ea33c51cf26 new file mode 100644 index 0000000000000000000000000000000000000000..bb8bb0630cea408888a7e55a019fdc6fb722258f GIT binary patch literal 88 zcmV-e0H^ElAYa$iG&CI&eZp~lt6)iKx=t62ai|3cQ1ha>9% literal 0 HcmV?d00001 diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/8d/d4290a6ccef367cde77cf95ec7449dca23d6bb b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/8d/d4290a6ccef367cde77cf95ec7449dca23d6bb new file mode 100644 index 0000000000000000000000000000000000000000..e1810f0850cee278ddd6ca496e538b672cf31e41 GIT binary patch literal 84 zcmV-a0IUCa0V^p=O;s>AVlXiP0)^!KT)ota#N2|MR0dnG*_Mrp$ApDLyKi`zCl{p$ q&sK$~O3TmJOG+$aD6qMvn!G~$>XZE{@iXkwgdX!tJ_G;|r5oi-7$^Av literal 0 HcmV?d00001 diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/b4/fc3812c95e3f5eed2ac1964a131464293786aa b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/b4/fc3812c95e3f5eed2ac1964a131464293786aa new file mode 100644 index 0000000000000000000000000000000000000000..e74d64efc7ddda955c3c63774f6973e02ac09267 GIT binary patch literal 127 zcmV-_0D%8^0V^p=O;s>7G-fa~FfcPQQSk9}cJ&K()hnqeVYud+8CGmE&(i(H({)b9 zx?G3Fe6E`q0D*$9Ylx$+r=J^xw$oLuH;R+7G-fa~FfcPQQSk9}cJ&K()hnqeVYud+8CGmE&(i(H({)b9 zx?G3Fe6E`q0D*$9Ylx$+r=J@`?-fn1oO7Sk&pxmD8F$=e?kVMKyP+lpxjMS|y6PpS h%Cn9zM(-@E9+!qq!Z{S$swnmIx70{|Z!FLTsgJ^%m! literal 0 HcmV?d00001 diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/f5/f3b2ddf93a179e1a0a93ccbf582d1e80648ce6 b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/f5/f3b2ddf93a179e1a0a93ccbf582d1e80648ce6 new file mode 100644 index 0000000000000000000000000000000000000000..3f92ba9ec01dda769fb4b14712a1cbd798b4d600 GIT binary patch literal 106 zcmV-w0G0oE0V^p=O;s>5Gh;9@00IRAJp(;M-C#e*fM5^*5C;DUpHIg{lU)}y7)I52 z`Q6bE%R3HHXb4njpyw3o>ElAYa$iG&CI&eZp~lt6)iKx=k6Ag1C8@hK)yJQu_VxZ zY*-2?j*g{)V${YmKr^vnS)e$ru^iA2c`~sAP@e*~nV?<#%0dIxtNbi^{g*iZ^iG}5 z-J@1{;#dQV;aTsZ&jJE}{`?J65dZSiKZ`x*M7e1~M)C_@_SJjS?yJ-!?RvS<|A**% zmFrW2O`7uT^B1Z##n!XE)f2UOVygNeV+ZHNXGb<0UoBmmypKVN{Km-yQw1yyJoXDjv-p$FskB@?PgCefT}nJ6$pOP*Kdfo3e{? z-#hJz*s=QcKhdd|qGn$I@US~r~+;$~HEm;CAB zyP|?y8c)6mO3>MQC>IaXc<^n#wtu!DZh~FyX8yNy{eZJ!z=_f z`;=v-^ULLo{mu8XH*^?G#)t|e;zeE1l#W?m$meHZ+Gj?XqeC1WVEzaXWMEHH)MSu3kU(v3( z(kORl!tScwcl+aVZ&!TV%dGm+E64fc^dA?js=hbty1bIlAZ zHkoJX{^IF6Cu3c%!(u+y-?yw>+PCn@HL0Sdul?I|y;ksRaeOH7Z2zrkz-qU%dC$6H zjTdJw>3IFi?l$Q!|Nk}S%+;xunaZMmQ2FP9olwS$Nfk1uTKpI#NN>wv3Faqlw zkpn<6AeOjj_S!GoW%1-aON2b;T+upyCS2R;^65?dGdvD|-*2|yg`}8jlam>TsyYC1 Crno`? literal 0 HcmV?d00001 diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/pack/pack-36eb4e6b44a393bca412489cd42ac7cc572b42d3.pack b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/objects/pack/pack-36eb4e6b44a393bca412489cd42ac7cc572b42d3.pack new file mode 100644 index 0000000000000000000000000000000000000000..fb8e35c7d121e3cef73384dfff5428d05b9ecf9d GIT binary patch literal 8048 zcma)>Wl$VU*0u)-?(XhECIk)c?(R;|;2wgz6C4J2oxy`kaCbs*8Ju9j!T|5H-#)ur zZ`Hn4-;e&;-KS1pec#>Zs7pvG0RRB_zXnY%hA*gWk_&6#9R{FJ1bmqoj;AH{wkQ^p z>k@_8jdqrYg(R{kKO_YC-KP6b>0mxwANdrK3qYUh8q;N(^}q!jITP-tr5^cZ8q~m7K?8OIi$Ky?`P(phZek4hdYd;h63tyNdO_C zV8`f^`icVbu&br{7K2T=PokflQ46ZF{-kxD3|dM>D@fEQa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-runner/src/test/resources/git_samples/contract-predefined-names-git/git/packed-refs b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/packed-refs new file mode 100644 index 0000000000..5a69e4592d --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/packed-refs @@ -0,0 +1,2 @@ +# pack-refs with: peeled fully-peeled +0b36113e5fa9713025d50f046e8fd209fc8d9597 refs/remotes/origin/master diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/refs/heads/master b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/refs/heads/master new file mode 100644 index 0000000000..84ea19cf42 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/refs/heads/master @@ -0,0 +1 @@ +51326f92638a0342965bc511cbcc2eab61b41050 diff --git a/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/refs/remotes/origin/HEAD b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/refs/remotes/origin/HEAD new file mode 100644 index 0000000000..6efe28fff8 --- /dev/null +++ b/spring-cloud-contract-stub-runner/src/test/resources/git_samples/contract-predefined-names-git/git/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +ref: refs/remotes/origin/master