{"id":13565072,"url":"https://github.com/tomjankes/wiremock-groovy","last_synced_at":"2025-04-03T22:30:31.802Z","repository":{"id":27464445,"uuid":"30943530","full_name":"tomjankes/wiremock-groovy","owner":"tomjankes","description":"groovy bindings for wiremock","archived":false,"fork":false,"pushed_at":"2023-04-28T08:55:17.000Z","size":127,"stargazers_count":43,"open_issues_count":3,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-04T18:45:59.389Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomjankes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-02-17T23:29:37.000Z","updated_at":"2024-03-23T12:19:07.000Z","dependencies_parsed_at":"2024-01-14T03:50:31.143Z","dependency_job_id":"98bfa6a4-b7c2-4c0d-a028-acb3048dbb76","html_url":"https://github.com/tomjankes/wiremock-groovy","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjankes%2Fwiremock-groovy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjankes%2Fwiremock-groovy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjankes%2Fwiremock-groovy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjankes%2Fwiremock-groovy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomjankes","download_url":"https://codeload.github.com/tomjankes/wiremock-groovy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247089698,"owners_count":20881820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:01:40.288Z","updated_at":"2025-04-03T22:30:31.110Z","avatar_url":"https://github.com/tomjankes.png","language":"Groovy","funding_links":[],"categories":["Groovy"],"sub_categories":[],"readme":"# Wiremock groovy\n[![Build Status](https://travis-ci.org/tomjankes/wiremock-groovy.svg?branch=master)](https://travis-ci.org/tomjankes/wiremock-groovy) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.tomjankes/wiremock-groovy/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.tomjankes/wiremock-groovy)\n## What it is\n\nI love [WireMock](https://github.com/tomakehurst/wiremock) and use it extensively in integration tests. I also love how [Spock](https://github.com/spockframework/spock) allows to write very readable and clean tests.\nThis project aims to create more suitable groovy API, that will allow more concise stubbing and verifying syntax in integration tests written in groovy/spock using WireMock, without using WireMock's default static imports API.\n\n## What it does\n\nCurrently there is only extremely thin wrapper for Wire Mock REST API, that is exposed as raw json builder.\nExamples of what can be currently achieved:\n\n### Stubbing\n\n```groovy\n@Rule\nWireMockRule wireMockRule = new WireMockRule()\n\ndef wireMockStub = new WireMockGroovy()\n\ndef \"some integration test that tests feature using external REST resource\" () {\n    given:\n    wireMockStub.stub {\n        request {\n            method \"GET\"\n            url \"/some/thing\"\n        }\n        response {\n            status 200\n            body \"Some body\"\n            headers {\n                \"Content-Type\" \"text/plain\"\n            }\n        }\n    }\n    ...\n}\n```\n\n### Verifying\n\nVerifying can be achieved by querying for count of matching requests that have been sent to WireMock server.\n\n```groovy\n@Rule\nWireMockRule wireMockRule = new WireMockRule()\n\ndef wireMockStub = new WireMockGroovy()\n\ndef \"example verifying test\" () {\n    ...\n    then:\n    1 == wireMockStub.count {\n        method \"GET\"\n        url \"/some/url\"\n    }\n}\n\ndef \"test using groovy truth if you need at least one request and shows example matcher\" () {\n    ...\n    then:\n    wireMockStub.count {\n        method \"POST\"\n        url \"/some/url\"\n        headers {\n            \"Content-Type\" {\n                matches \".*xml\"\n            }\n        }\n    }\n}\n```\n\n##Contribution\n\nProject is in very early stage, pull requests and ideas in form of feature requests are welcome.\n\n## Building\n\n* Clone the repository\n* Run `./gradlew clean build` (on Linux/Mac) or `gradlew.bat build` (on Windows)\n\n## Licence\n\nApache Licence v2.0 (see LICENCE.txt)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomjankes%2Fwiremock-groovy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomjankes%2Fwiremock-groovy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomjankes%2Fwiremock-groovy/lists"}