Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Rest Assured tests with Spring RESTdocs #334

Closed
dsyer opened this issue Jun 20, 2017 · 8 comments
Assignees
Labels
Milestone

Comments

@dsyer
Copy link
Contributor

@dsyer dsyer commented Jun 20, 2017

Spring RESTdocs has support for full stack tests with snippet generation using Rest Assured, and Rest Assured is already a dependency in spring-cloud-contract for other reasons, so it makes sense to make the RESTdocs bit work the same as it does with MockMvc.

@dsyer dsyer added the enhancement label Jun 20, 2017
@dsyer dsyer self-assigned this Jun 20, 2017
@dsyer dsyer added this to the 1.2.0 milestone Jun 20, 2017
@eddumelendez

This comment has been minimized.

Copy link
Contributor

@eddumelendez eddumelendez commented Jul 7, 2017

is this issue still planned for version 1.2.0? I have sent a PR spring-projects/spring-boot#9643 in order to support RestDocs RestAssured auto-configuration which is planned for spring-boot 2.0.0.

I would like to work on this, so should I wait? or spring-cloud-contract can provide restassured configuration for 1.2.0 and when moving to 2.0.0 should be aligned with the auto-configuration provided by spring-boot?

@dsyer

This comment has been minimized.

Copy link
Contributor Author

@dsyer dsyer commented Jul 7, 2017

I already have some code that works here if it helps: https://github.com/dsyer/spring-cloud-netflix/blob/feature/eureka-stubs/spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/doc/AbstractDocumentationTests.java. It would be a lot neater if it was backed by Spring Boot natively, and I'm not sure it makes sense to add features in spring-cloud-contract until Boot catches up, given that it is relatively easy to write custom code to integrate RestAssured.

Maybe we can persuade the Boot team to backport to 1.5.x (I don't see any reason why it wouldn't work)? Then we could do it in 1.x.

@eddumelendez

This comment has been minimized.

Copy link
Contributor

@eddumelendez eddumelendez commented Jul 8, 2017

Indeed it would be cool the approach to backport. I just add one more commit spring-projects/spring-boot@826c0f8 to my initial PR in order to provide the customizer needed by spring-cloud-contract and make the integration easier.

May @wilkinsona can add few comments about the idea to backport restassured integration to spring-boot 1.5.x.

@wilkinsona

This comment has been minimized.

Copy link
Contributor

@wilkinsona wilkinsona commented Jul 8, 2017

I am not keen on backporting to 1.5.x as that would be REST Docs 1.1 and REST Assured 2

@marcingrzejszczak

This comment has been minimized.

Copy link
Contributor

@marcingrzejszczak marcingrzejszczak commented Aug 22, 2017

@dsyer since the code will not be backported, will you apply your patch also here or do you want me to do it? We can also assume that the support will be there out of the box with version 2.0.0, right?

@dsyer

This comment has been minimized.

Copy link
Contributor Author

@dsyer dsyer commented Aug 22, 2017

That wasn't my reading of the above (or maybe I misunderstood you). Spring Boot 1.5.x will not have the customizer hooks we need, but 2.0.x will. We still need to add some code to Spring Cloud Contract I think (to match the features in MockMvc), so it will be easier to do in 2.0.x, and I assume we will leave 1.x as an implementation exercise for users (possibly copying the code I used above). If @eddumelendez wants to do the work, that's awesome.

@marcingrzejszczak marcingrzejszczak modified the milestones: 1.2.0.M2, 1.2.0.M1 Aug 25, 2017
@marcingrzejszczak

This comment has been minimized.

Copy link
Contributor

@marcingrzejszczak marcingrzejszczak commented Aug 28, 2017

Ok then so I'll mark this as to be done for 2.0.x. If the users have something prepared for 1.5.x boot then we will work on the PR.

@marcingrzejszczak marcingrzejszczak modified the milestones: 2.0.0.M3, 1.2.0.M2 Aug 28, 2017
eddumelendez added a commit to eddumelendez/spring-cloud-contract that referenced this issue Oct 1, 2017
marcingrzejszczak added a commit that referenced this issue Oct 16, 2017
@marcingrzejszczak

This comment has been minimized.

Copy link
Contributor

@marcingrzejszczak marcingrzejszczak commented Oct 16, 2017

Done via #431

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.