You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
Please consider the code at https://github.com/acet/rest_assured_demo_spring_starter
As you can see there are 3 levels of testing:
test - Spring webmvc unit test
integTest - Spring boot integration test
functionalTest - cucumber functional test
com.acet.testphases.demo.RestClient
This uses a MockMvc backed RestAssured to call the single endpoint available (test and integTest)
com.acet.testphases.demo.FunctionalTestRestClient
This uses standard RestAssurred to call the endpoint when the application is deployed (functionalTest)
As you can see the method "getSum" in both is the same. From what I have found though I need to have the two implementations of RestClient as I must import either import static io.restassured.module.mockmvc.RestAssuredMockMvc.given;
or import static io.restassured.RestAssured.given;
Do you know is there some way I could create a common RestClient here that may or may not be backed by MockMvc?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
acet
changed the title
Using the same class for RestAssurred and MockMvcRestAssurred
Using the same class for RestAssurred and RestAssuredMockMvc
Feb 26, 2019
acet
changed the title
Using the same class for RestAssurred and RestAssuredMockMvc
Using the same Class for RestAssured and RestAssuredMockMvc
Feb 27, 2019
They are so different implementations so I've not even considered a single endpoint. It's not possible, in a generic way, to know if the server is implemented using Spring MVC and if you want to use MockMvc to test it. So I don't think it makes sense with a single API entry.
Hello,
Please consider the code at
https://github.com/acet/rest_assured_demo_spring_starter
As you can see there are 3 levels of testing:
test - Spring webmvc unit test
integTest - Spring boot integration test
functionalTest - cucumber functional test
com.acet.testphases.demo.RestClient
This uses a MockMvc backed RestAssured to call the single endpoint available (test and integTest)
com.acet.testphases.demo.FunctionalTestRestClient
This uses standard RestAssurred to call the endpoint when the application is deployed (functionalTest)
As you can see the method "getSum" in both is the same. From what I have found though I need to have the two implementations of RestClient as I must import either
import static io.restassured.module.mockmvc.RestAssuredMockMvc.given;
or
import static io.restassured.RestAssured.given;
Do you know is there some way I could create a common RestClient here that may or may not be backed by MockMvc?
Thanks in advance.
The text was updated successfully, but these errors were encountered: