{"id":25776201,"url":"https://github.com/rest-driver/rest-driver","last_synced_at":"2025-02-27T06:05:48.246Z","repository":{"id":42832624,"uuid":"1644585","full_name":"rest-driver/rest-driver","owner":"rest-driver","description":"Test Driver to test your RESTful services and clients","archived":false,"fork":false,"pushed_at":"2024-10-19T01:47:42.000Z","size":1491,"stargazers_count":170,"open_issues_count":48,"forks_count":56,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-11-17T13:09:09.792Z","etag":null,"topics":["java","rest","testing"],"latest_commit_sha":null,"homepage":"https://github.com/rest-driver/rest-driver/wiki","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rest-driver.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":"2011-04-21T08:57:51.000Z","updated_at":"2024-11-12T07:00:54.000Z","dependencies_parsed_at":"2024-05-07T15:49:13.332Z","dependency_job_id":"ad5fa3be-2e31-494e-bedb-43970961baff","html_url":"https://github.com/rest-driver/rest-driver","commit_stats":null,"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rest-driver%2Frest-driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rest-driver%2Frest-driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rest-driver%2Frest-driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rest-driver%2Frest-driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rest-driver","download_url":"https://codeload.github.com/rest-driver/rest-driver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240987435,"owners_count":19889333,"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":["java","rest","testing"],"created_at":"2025-02-27T06:01:19.153Z","updated_at":"2025-02-27T06:05:48.240Z","avatar_url":"https://github.com/rest-driver.png","language":"Java","readme":"# REST-driver\n\n[![Build Status](https://secure.travis-ci.org/rest-driver/rest-driver.png?branch=master\u0026style=plastic)](http://travis-ci.org/rest-driver/rest-driver)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.rest-driver/rest-driver/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.rest-driver/rest-driver/badge.svg)\n\nTest Driver to test your RESTful services and clients.\n\nThere are two libraries here:\n\n* REST server driver - for testing your RESTful service\n* REST client driver - for testing your RESTful client \u0026 mocking remote services\n\nPlease note: version `2.0.0` onwards will require Java 8.\n\n[Downloads](https://github.com/rest-driver/rest-driver/wiki/Downloads) - [Server Driver](https://github.com/rest-driver/rest-driver/wiki/Server-Driver) - [Client Driver](https://github.com/rest-driver/rest-driver/wiki/Client-driver)\n\n## Goals\n\nEveryone knows that testing is good for your health and REST is good for your sanity.  Now it is easy to keep both in check by allowing you to write _quick_, _readable_, _fluid_ tests which are easy to refactor and give excellent error handling/reporting.  So we provide these libraries to test from both ends of the pipe.\n\n## REST server driver\n\nIn order to do thorough testing of your RESTful service, you'll have to make actual HTTP requests and check the actual HTTP responses from your service.  REST driver makes this as easy as:\n\n```java\nResponse response = get( \"http://www.example.com\" );\n\nassertThat(response, hasStatusCode(200));\nassertThat(response.asJson(), hasJsonPath(\"$.name\", equalTo(\"jeff\")));\n```\n\nMore info: [Server Driver](https://github.com/rest-driver/rest-driver/wiki/Server-Driver)\n\n## REST client driver\n\nIf you have a client for a RESTful service, it's not ideal to have an actual service running somewhere to test against.  This is difficult to keep on top of, makes for brittle/flickering tests, and tightly couples your tests to someone else's code.\n\nWe provide a mock-like interface which launches a real HTTP server and allows setup like this:\n\n```java\nclientDriver.addExpectation(onRequestTo(\"/\").withMethod(Method.GET), \n                            giveResponse(\"some wonderful content\", \"text/plain\"));\n```\n\nThe server will listen for a requests and respond with the replies you set.  Any unexpected action or unmet expectation will fail your tests.\n\nYou can also use the client-driver to mock out any remote services which your RESTful service uses.\n\nMore info: [Client Driver](https://github.com/rest-driver/rest-driver/wiki/Client-driver)\n\n## Other languages\n\n* [rest-cljer](https://github.com/whostolebenfrog/rest-cljer), a convenient Clojure wrapper for REST client driver.\n\n","funding_links":[],"categories":["测试"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frest-driver%2Frest-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frest-driver%2Frest-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frest-driver%2Frest-driver/lists"}