REST API integration tests with java / scala / groovy

We have the Json REST API built into Java (spring, gradle).

We would like to conduct integration testing of our REST API.

We would like to reuse Java Dto objects that are displayed through our REST API when building tests - this means that we will have to write tests in java / scala / groovy / etc.

Any suggestions on framework / testing tools that are easy to use and with less standard code?

+4
source share
1 answer

I would highly recommend rest-driver:

https://github.com/rest-driver/rest-driver

, :

https://github.com/rest-driver/rest-driver/wiki/Server-Driver

github , REST API:

@Test
public void getJsonResponse() {
    Response response = get(BASE_URL + "/things/5", header("Accept", "application/json"));
    assertThat(response, hasStatusCode(200));
}

DTO, response.asJSON(), DTO JSON, (Jackson, GSON ..).

:

https://github.com/scobal/seyren/blob/master/seyren-acceptance-tests/src/test/java/com/seyren/acceptancetests/AlertsAT.java

+3

Source: https://habr.com/ru/post/1526353/


All Articles