Giter Site home page Giter Site logo

kelveden / rest-driver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rest-driver/rest-driver

1.0 2.0 0.0 1.27 MB

Test Driver to test your RESTful services and clients

Home Page: rest-driver.github.com

License: Other

Java 99.68% Shell 0.32%

rest-driver's Introduction

#REST-driver

Build Status

Test Driver to test your RESTful services and clients.

There are two libraries here:

  • REST server driver - for testing your RESTful service
  • REST client driver - for testing your RESTful client & mocking remote services

Latest version: 1.1.32

Downloads - Server Driver - Client Driver

##Goals

Everyone 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.

##REST server driver

In 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:

Response response = get( "http://www.example.com" );

assertThat(response, hasStatusCode(200));
assertThat(response.asJson(), hasJsonPath("$.name", equalTo("jeff")));

More info: Server Driver

##REST client driver

If 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.

We provide a mock-like interface which launches a real HTTP server and allows setup like this:

clientDriver.addExpectation(onRequestTo("/").withMethod(Method.GET), 
                            giveResponse("some wonderful content", "text/plain"));

The server will listen for a requests and respond with the replies you set. Any unexpected action or unmet expectation will fail your tests.

You can also use the client-driver to mock out any remote services which your RESTful service uses.

More info: Client Driver

Other languages

  • rest-cljer, a convenient Clojure wrapper for REST client driver.

rest-driver's People

Contributors

neilprosser avatar joelittlejohn avatar kelveden avatar ahjones avatar banksysan avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.