Is there any reason to avoid using rest-assured
in a non-testing-environment?
The syntax the library offers for creating and parsing requests is so compact it seems a waste to only use it in testing.
Which kind of begs the question, why is it targeted as a testing tool alone?
REST Assured is a high level Java DSL for simplified testing of REST based services built over HTTP. On the other hand, HttpClient is a low level client for simplifying Http Communication, In-fact HttpClient is used by REST Assured under the hood for Http communication.
HTTP client is a client that is able to send a request to and get a response from the server in HTTP format. REST client is a client that is designed to use a service from a server and this service is RESTful.
I'm the founder of REST Assured and it has always primarily been targeted towards testing. For example the default port is 8080, it ships with Hamcrest matchers (which is used internally as well so it cannot be excluded) and performance could probably be optimized somewhat. It also depends on Groovy which can be quite a large dependency to add to a production system if all you need is an HTTP client.
People, including myself on occasion, are using it in production because it's easy and flexible to use. Not all use cases require state of the art performance with a minimum number of dependencies. So for certain bounded contexts REST Assured will probably make a lot of sense.
One of my goals with REST Assured is to extract a more lightweight core and remove the need for Hamcrest and potentially even Groovy in the future. Some steps have already been taken in this direction when JsonPath and XmlPath were extracted to their own projects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With