{"id":17216541,"url":"https://github.com/antechrestos/rest-client-test","last_synced_at":"2026-01-14T02:41:42.530Z","repository":{"id":115414319,"uuid":"61527302","full_name":"antechrestos/rest-client-test","owner":"antechrestos","description":null,"archived":true,"fork":false,"pushed_at":"2018-06-25T15:57:18.000Z","size":34,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T15:32:04.581Z","etag":null,"topics":["rest","spring","unit-testing"],"latest_commit_sha":null,"homepage":null,"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/antechrestos.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-20T07:54:32.000Z","updated_at":"2023-12-05T14:36:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"bdd5eda7-a8d5-4b2c-9ece-78d4a2115884","html_url":"https://github.com/antechrestos/rest-client-test","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/antechrestos/rest-client-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antechrestos%2Frest-client-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antechrestos%2Frest-client-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antechrestos%2Frest-client-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antechrestos%2Frest-client-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antechrestos","download_url":"https://codeload.github.com/antechrestos/rest-client-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antechrestos%2Frest-client-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["rest","spring","unit-testing"],"created_at":"2024-10-15T03:28:01.107Z","updated_at":"2026-01-14T02:41:42.523Z","avatar_url":"https://github.com/antechrestos.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rest Client Test  [![maven](http://img.shields.io/maven-central/v/com.github.antechrestos/restclienttest.svg)](https://oss.sonatype.org/#nexus-search;quick~restclienttest) [![license](https://img.shields.io/github/license/antechrestos/rest-client-test.svg)](https://raw.githubusercontent.com/antechrestos/rest-client-test/master/LICENSE)\n\n## Description\n\nThis project brings you a simple library to mock spring rest template in order to test your client.\n\nExample: The following example registers a `POST` made on `http://somewhere.org`, with the request body `\"some body\"`. This call will return a `OK` status code with the content of the file found in classpath `fixtures/POST.json`.\n\nThe call to `restTemplate` must be a `POST` on the matching `url`. The call will check that the body submitted matched the one given at context registration.\n\n```java\nrestTemplate.setRequestFactory(clientHttpRequestFactory);\nclientHttpRequestFactory.register(\n\t\tContext.builder()\n\t\t\t\t.url(\"http://somewhere.org\")\n\t\t\t\t.queryParameter(\"some_parameter\", Collections.singletonList(\"some_value\"))\n\t\t\t\t.statusCode(HttpStatus.OK)\n\t\t\t\t.method(HttpMethod.POST)\n\t\t\t\t.requestPayload(Payload.builder()\n\t\t\t\t\t\t.type(Payload.Type.RAW_STRING)\n\t\t\t\t\t\t.value(\"some body\")\n\t\t\t\t\t\t.build())\n     \t\t\t\t.responsePayload(Payload.builder()\n      \t\t\t\t\t\t.type(Payload.Type.CLASSPATH_RESOURCE)\n\t\t\t\t\t\t.value(\"fixtures/POST.json\")\n\t\t\t\t\t\t.build())\n\t\t\t\t.build()\n);\n// use restTemplate\n```\n\n### Query parameters\n\nQuery parameters may either be specified in the `url`creation paramers, or by using the `builder` method `queryParameter`. If both way are used, the checked query parameters will be a merge of the two methods.\nThey are checked when the call is made.\n\n### Request headers\nHeaders specified by the `builder` method `header` are checked when the call is made.\n\n### Request payload\nA check on the body that is sent can be made. You may either specify a `Payload.Type.RAW_STRING` or a `Payload.Type.CLASSPATH_RESOURCE`where the content will be loaded and compared to the sent body.\n\n### Status code\nThe status code that will be returned\n\n### Response headers\nThe headers that will be sent by the call.\n\n### Response payload\nThe response body returned. You may either specify a `Payload.Type.RAW_STRING` or a `Payload.Type.CLASSPATH_RESOURCE` where the content will be loaded and sent as a body.\n\n\n\n\n## Add to your project\n\nAdd the dependency to your project by using maven:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.antechrestos\u003c/groupId\u003e\n    \u003cartifactId\u003erestclienttest\u003c/artifactId\u003e\n    \u003cversion\u003e1.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantechrestos%2Frest-client-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantechrestos%2Frest-client-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantechrestos%2Frest-client-test/lists"}