Articles Tagged ‘restful’

Writing BDD-Style Webservice Tests with Karate and Java

Thursday, April 6th, 2017

There is a new testing framework out there called Karate that is build on top of the popular Cucumber framework.

Karate makes it easy to script interactions with out web-services under test and verify the results. In addition it offers us a lot of useful features like parallelization, script/feature re-use, data-tables, JsonPath and XPath support, gherkin syntax, switchable staging-configurations and many others.

In the following tutorial we’ll be writing different scenarios and features for a real-world RESTful web-service to demonstrate some of its features.

(more…)

Creating REST Clients for JAX-RS based Webservices with Netflix Feign

Thursday, October 22nd, 2015

For us developers there plenty of libraries exist helping us in deriving and generating clients for existing RESTful web-services and I have already covered some of the in this blog (e.g. the JAX-RS Client API). Nevertheless, I’d like to share my experience with another interesting lightweight library here: Netflix Feign.

Feign offers a nice fluent-builder API, a rich integration for  common libraries and APIs like JAX-RS, Jackson, GSON, SAX, JAX-B, OkHttp, Ribbon, Hystrix, SLF4J and more and last bot not least, it is setup easy and the service contracts are specified using interfaces and annotations.

In the following tutorial I’d like to demonstrate how to derive a service binding from a simple, JAX-RS based RESTful web-service, how to create the service adapter using the integrated builder and at last, performing CRUD operations.

(more…)

Integrating Swagger into a Spring Boot RESTful Webservice with Springfox

Wednesday, July 1st, 2015

Spring Boot allows us to create RESTful web-services with ease, Swagger specifies a format to describe the capabilities and operations of these services and with Swagger UI it is possible to explore our REST API with a nice graphical user interface in our browser.

Springfox is a project that aims at creating automated JSON API documentation for API’s built with Spring and is used in the following tutorial to integrate Swagger into a sample application.

(more…)

Documenting RESTful Webservices in Swagger, AsciiDoc and Plain Text with Maven and the JAX-RS Analyzer

Tuesday, June 16th, 2015

A variety of different tools exists to help us analyze RESTful web-services and create documentations for their APIs in different formats.

In the following tutorial I’d like to demonstrate how to document an existing JAX-RS web-service in multiple formats like Swagger, AsciiDoc or Plain Text using Maven, the JAX-RS Analyzer and the JAX-RS Analyzer Maven Plugin.

The JAX-RS Analyzer gathers its information not only by reflection like most other tools but also by bytecode analysis and therefore does not require us to add special annotations for documentation to our code.

(more…)

REST-assured vs Jersey-Test-Framework: Testing your RESTful Web-Services

Monday, September 5th, 2011

Today we’re going to take a look at two specific frameworks that enables you to efficiently test your REST-ful services: On the one side there is the framework REST-assured that offers a nice DSL-like syntax to create well readable tests – on the other side there is the Jersey-Test-Framework that offers a nice execution environment and is built upon the JAX-RS reference implementation, Jersey.

In the following tutorial we’re going to create a simple REST service first and then implement integration tests for this service using both frameworks.

The title of this article might be misleading due to the fact that I am not going to compare both frameworks to choose a winner, just showing the different approach ..

(more…)

Search
Categories