Skip to content

Commit a2f8ab5

Browse files
committed
wiremock: bundle stubs locally
1 parent 8ee219c commit a2f8ab5

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

‎wiremock/bin/create-stubs.sh‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
# Import stubs into OSS WireMock (for WireMock Runner, use setup-wiremock-runner.sh)
44

5-
STUBS_URL="${STUBS_URL:-https://library.wiremock.org/catalog/api/p/personio.de/personio-de-personnel/personio.de-personnel-stubs.json}"
6-
TMP_STUBS_FILE="/tmp/personio-stubs.json"
5+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6+
STUBS_FILE="${SCRIPT_DIR}/../sample-app-oss/stubs.json"
77
WIREMOCK_URL="${WIREMOCK_URL:-http://wiremock.localhost.localstack.cloud:4566}"
88

9-
echo "Downloading stubs from ${STUBS_URL}..."
10-
curl -s -o "$TMP_STUBS_FILE" "$STUBS_URL"
11-
9+
# Note: stubs are bundled locally because library.wiremock.org now redirects to HTML
10+
# rather than serving the JSON file directly, making the remote URL unreliable.
1211
echo "Importing stubs into WireMock at ${WIREMOCK_URL}..."
13-
curl -v -X POST -H "Content-Type: application/json" --data-binary "@$TMP_STUBS_FILE" "${WIREMOCK_URL}/__admin/mappings/import"
12+
curl -v -X POST -H "Content-Type: application/json" --data-binary "@$STUBS_FILE" "${WIREMOCK_URL}/__admin/mappings/import"
1413

1514
echo ""
1615
echo "Verify stubs at: ${WIREMOCK_URL}/__admin/mappings"

0 commit comments

Comments
 (0)