{"id":20717356,"url":"https://github.com/cjstehno/ersatz","last_synced_at":"2025-08-23T22:09:31.475Z","repository":{"id":13912862,"uuid":"75326472","full_name":"cjstehno/ersatz","owner":"cjstehno","description":"🤖 A simulated HTTP server for testing client code with configurable responses.","archived":false,"fork":false,"pushed_at":"2025-02-19T16:39:28.000Z","size":12617,"stargazers_count":48,"open_issues_count":12,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-07T21:15:09.604Z","etag":null,"topics":["groovy","http","java","mock"],"latest_commit_sha":null,"homepage":"https://cjstehno.github.io/ersatz","language":"Java","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/cjstehno.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-12-01T19:42:00.000Z","updated_at":"2025-04-15T14:02:16.000Z","dependencies_parsed_at":"2024-01-03T01:20:36.976Z","dependency_job_id":"a2086fb2-92ed-4467-b74a-36904dfacc8b","html_url":"https://github.com/cjstehno/ersatz","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/cjstehno/ersatz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjstehno%2Fersatz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjstehno%2Fersatz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjstehno%2Fersatz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjstehno%2Fersatz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cjstehno","download_url":"https://codeload.github.com/cjstehno/ersatz/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjstehno%2Fersatz/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265492779,"owners_count":23776116,"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":["groovy","http","java","mock"],"created_at":"2024-11-17T03:08:38.894Z","updated_at":"2025-07-16T07:39:27.051Z","avatar_url":"https://github.com/cjstehno.png","language":"Java","funding_links":["https://www.paypal.com/donate/?hosted_button_id=JA246LUCNUDHC"],"categories":["Testing"],"sub_categories":[],"readme":"# Ersatz Server\r\n\r\n\u003e If you use this project and would like to help keep it running, please consider making a donation.\r\n\u003e\r\n\u003e [☕ Buy me a coffee?](https://www.paypal.com/donate/?hosted_button_id=JA246LUCNUDHC)\r\n\r\n## Quick Links\r\n\r\n* Site: https://cjstehno.github.io/ersatz\r\n* Project: https://github.com/cjstehno/ersatz\r\n* User Guide: https://cjstehno.github.io/ersatz/docs/user_guide.html\r\n* Java API Docs: https://cjstehno.github.io/ersatz/javadoc/\r\n* Groovy API Docs: https://cjstehno.github.io/ersatz-groovy/javadoc/\r\n\r\n## Introduction\r\n\r\nThe Ersatz Server is a HTTP client testing tool which allows for request/response expectations to be configured in a \r\nflexible manner. The expectations will respond in a configured manner to requests and allow testing with different \r\nresponses and/or error conditions without having to write a lot of boiler-plate code.\r\n\r\n\u003e **Warning:** v3.x is **NOT** directly backwards compatible with the 2.x releases. Some lesser-used features have been \r\n\u003e removed and the Groovy DSL has been extracted into its own extension library - see the \r\n\u003e [What's New in 3.0](http://cjstehno.github.io/ersatz/docs/user_guide.html#_in_3.0) section of the User Guide for \r\n\u003e details and a migration guide.\r\n\r\n\u003e **Warning:** v2.x has removed some unused features of the library and extracted the Groovy support into it's own \r\n\u003e extension library. See the [What's New in 2.0](http://cjstehno.github.io/ersatz/docs/user_guide.html#_in_2.0) section \r\n\u003e of the User Guide for details and a migration guide.\r\n\r\n## Getting Started\r\n\r\nProject artifacts are available via the Maven Central repository. Below are the dependency coordinates for Gradle and \r\nMaven, more details are provided in the \r\n[Getting Started](http://cjstehno.github.io/ersatz/docs/user_guide.html#_getting_started) section of the User Guide.\r\n\r\n### Gradle\r\n\r\n    testImplementation 'io.github.cjstehno.ersatz:ersatz:4.0.1'\r\n\r\n    // or, for the Groovy DSL extensions\r\n    testImplementation 'io.github.cjstehno.ersatz:ersatz-groovy:4.0.1'\r\n\r\n### Maven\r\n\r\n    \u003cdependency\u003e\r\n        \u003cgroupId\u003eio.github.cjstehno.ersatz\u003c/groupId\u003e\r\n        \u003cartifactId\u003eersatz\u003c/artifactId\u003e\r\n        \u003cversion\u003e4.0.1\u003c/version\u003e\r\n        \u003cscope\u003etest\u003c/scope\u003e\r\n    \u003c/dependency\u003e\r\n    \r\n    \u003c!-- or, for the Groovy DSL extensions --\u003e\r\n    \u003cdependency\u003e\r\n        \u003cgroupId\u003eio.github.cjstehno.ersatz\u003c/groupId\u003e\r\n        \u003cartifactId\u003eersatz-groovy\u003c/artifactId\u003e\r\n        \u003cversion\u003e4.0.1\u003c/version\u003e\r\n        \u003cscope\u003etest\u003c/scope\u003e\r\n    \u003c/dependency\u003e\r\n\r\n### Shadowed\r\n\r\nThere is a `safe` (shadowed) version of each library available, which is useful in cases where you already  have a version of Undertow in use (to avoid version collisions). See the [Shadow Jar](http://cjstehno.github.io/ersatz/docs/user_guide.html#_shadow_jar)\r\nsection of the User Guide for more information.\r\n\r\n## Build Instructions\r\n\r\nErsatz is built using Gradle:\r\n\r\n    ./gradlew clean build\r\n\r\nOr, if the \"shadow\" artifact is desired:\r\n\r\n    ./gradlew clean build shadowJar\r\n\r\nIf you are interested in building the website, with all documentation and reports, you can run the following:\r\n\r\n    ./gradlew site\r\n\r\nIn order to build specific reports, run the appropriate one of the following:\r\n\r\n    ./gradlew asciidoctor\r\n    ./gradlew javadoc\r\n    ./gradlew jacocoTestReport\r\n    ./gradlew test\r\n    \r\n## Publishing\r\n\r\n### To Local Maven Repo\r\n\r\nYou can publish the all the source, javadoc, \"safe\" and regular jars to your local maven repository (`~/.m2/repository` directory) using the following command:\r\n\r\n    ./gradlew publishToMavenLocal -x signErsatzGroovyPublication signErsatzPublication\r\n    \r\n    // or, if you have not built recently\r\n    ./gradlew clean build publishToMavenLocal -x signErsatzGroovyPublication signErsatzPublication\r\n\r\nThe `-x sign` skips the signing step, which requires signing information. See the section on \"signing\" below if you need \r\nto have the locally published artifacts signed.\r\n\r\n### To Maven Central\r\n\r\nBefore you publish a release, be sure to generate a release build (see signing section for details):\r\n\r\n    ./gradlew clean build shadowJar signErsatzGroovyPublication signErsatzPublication -Psigning.gnupg.keyName=\u003ckey-id\u003e -Psigning.gnupg.passphrase=\u003ckey-pass\u003e\r\n\r\nThen, to publish the artifacts to the Maven Central Repository, run\r\n\r\n    ./gradlew publish -PossrhUser=\u003cjira-user\u003e -PossrhPass=\u003cjira-pass\u003e -Psigning.gnupg.keyName=\u003ckey-id\u003e -Psigning.gnupg.passphrase=\u003ckey-pass\u003e\r\n\r\nThe additional \"signing.\" properties are required to sign the artifacts, see the Signing section below for more details.\r\n\r\nOnce the artifacts have been published, sign-in to https://s01.oss.sonatype.org and navigate to the \"Staging Repositories\" \r\nand \"Close\" the published artifacts - this may take some time to appear. If there are errors, you can \"Drop\" it, fix them and publish again.\r\n\r\nAfter you have successfully \"closed\" the staging repository, you can release it by pressing the \"Release\" button.\r\n\r\n#### Signing\r\n\r\nWhen publishing the artifacts to the Maven Central Repository, they need to be signed. In order to keep the signing \r\ninformation secret, the properties are added only when the publishing task is executed, on the command line.\r\n\r\nWhen you want to sign the published artifacts, add the following parameters to the command line:\r\n\r\n    -Psigning.gnupg.keyName=\u003clast-8-of-key\u003e -Psigning.gnupg.passphrase=\u003ckey-password\u003e\r\n\r\nwhere `\u003clast-8-of-key\u003e` is the last 8 characters of the key, and `\u003ckey-password\u003e` is the password for the key.\r\n\r\nYou can list the available keys using:\r\n\r\n    gpg -k\r\n\r\n## Documentation Site\r\n\r\n### Building\r\n\r\nYou can build the documentation website using the following:\r\n\r\n    ./gradlew site\r\n\r\nWhich will build all Javadocs, User Guide, build reports and the website itself.\r\n\r\n### Publishing\r\n\r\nPublishing the website is a bit of an odd process:\r\n\r\n1. Create a separate clone of the ersatz project repo with a different name (e.g. `ersatz-site`).\r\n2. In the `ersatz-site` repo checkout the `gh-pages` branch - you should see only website content in that repo now.\r\n3. Publish the updated site content **from the main project** by running: `rsync -r build/site/* ../ersatz-site/`\r\n4. In the `ersatz-site` project add, commit and push the changes into the `gh-pages` branch.\r\n\r\nAt this point the website will be published but it may take some time for GitHub to reload the changes.\r\n\r\n## License\r\n\r\n```\r\nCopyright (C) 2023 Christopher J. Stehno\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n        http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjstehno%2Fersatz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcjstehno%2Fersatz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjstehno%2Fersatz/lists"}