Skip to content

RESTflow is a small Groovy DSL that enables to talk to REST services.

License

Notifications You must be signed in to change notification settings

Abnaxos/restflow

 
 

Repository files navigation

Project status

For now, this is just a quick fork from netconomy/restflow to fix some major breakages, mostly in the IDEA plugin.

Thanks a lot to NETCONOMY for releasing the source code and thus allowing this tool to live on. :)

RESTflow

RESTflow is a Groovy DSL that allows to easily communicate with REST endpoints (any HTTP endpoints, actually). A small example of what this looks like:

apply 'local' // apply profile for local testing
def myCartId = '...' // probably multiple REST calls
POST("/carts/$myCartId") {
  json [ product: [code: '12345'], quantity: 1]
}
assert response.statusCode == 200
assert response.json.quantityAdded == 1
// you can also replace 'json' with 'xml', looks more or less the same

It also includes an IDEA plugin that makes IDEA fully aware of the DSL. You can run RESTflow scripts from within the IDE and use it as an interactive console. The log is presented in an interface similar to the unit test run window:

Screenshot of RESTflow console

Other front-ends included are a simple command line runner and a console based on the standard Groovy console.

Because it's basically just Groovy, it seamlessly integrates with Spock for automated integration tests:

when: "Post this and that to my endpoint"
POST('this/and/that') {
    xml.'my-root' {
        'my-element'('my-attr': 42, 'foo')
    }
}

then: "The return code is OK"
response.statusCode == 200

For full documentation see the API docs of the DSL classes:

About

RESTflow is a small Groovy DSL that enables to talk to REST services.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 65.2%
  • Groovy 34.6%
  • Other 0.2%