swangkkb / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

Provide common interface for RequestSpecification and MockMvcRequestSpecification compatibility #369

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
As discussed here: 
https://groups.google.com/forum/#!topic/rest-assured/vqXqsyikhXM

It seems the traditional RequestSpecification and Spring specific 
MockMvcRequestSpecification are not compatible.
They both implement interfaces but are not compatible.

What I was looking for is to have something like:

RequestSpecification requestSpec = null
if (mockMvc) {
   requestSpec = RestAssuredMockMvc.given();
} else {
   requestSpec = RestAssured.with();
} 
requestSpec.given()..when()..then()..;

Would something like this be possible.

This way I would be able to re-use tesst and perform them 1) as 
junit/integration tests using MockMvc and 2) as acceptance testing against an 
actual running server.

Original issue reported on code.google.com by marceloverdijk on 5 Nov 2014 at 8:18