Closed psamsotha closed 8 years ago
It would be great to see integration with Jersey in spring-restdocs
@psamsotha Sorry for the delayed response. Thank you for sharing the results of your few days of hacking.
I'm not very experienced with Jersey, and I have never used its test framework before, so it'll take me a little while to bring myself up to speed so that I can offer an informed opinion on what you have done. That said, at first glance, it looks very good indeed.
As part of adding support for REST Assured, I reworked the configurer classes quite a bit. Unfortunately, I think those changes will have broken what you've got in your fork at the moment. There's no need to do anything about that just now, though. It's just something that occurred to me on my first read-through of your implementation.
@wilkinsona Thanks for the response. I created another implementation based on the changes made with the new config package. I actually changed the implementation to look more like the REST Assured implementation, i.e. using filters for the documentation and configuration. When I wrote my first implementation, there really wasn't much REST assured implementation code to go off of. But now it looks like it almost ready to go, I was able to work the implementation to closely mimic that of REST Assured's. It still needs some work though. I'll keep playing around with it.
One thing I wanted to ask (that I didn't really care to open an issue for), was it a conscious decision to use String literals all over that place, rather than constants? I say "all over the place" like there's a lot but it's only in a couple places I'm talking about. For instance with the URL template attribute name, that's used it the PathParameterSnippet
. This attribute is used in all three artifacts. I would imagine using a constant might be better, unless it was a conscious decision on your part not to do so.
This attribute is used in all three artifacts. I would imagine using a constant might be better, unless it was a conscious decision on your part not to do so.
It was a conscious decision while the API was settling down, but that time has passed. I've opened #193 to introduce some constants. Thanks for the nudge.
I would also like to use Jersey Test with Spring REST Docs. Is there anything in the second pull request that is blocking moving forward?
@azell Things never got as far as a pull request. @psamsotha What's the status of your implementation that was modelled on what I've done for REST Assured? You said above that it "needs some work though". Would you like to get it into a state that you're happy with and submit a pull request?
So these past few days, I actually have been working on this. You can have a look at the project. I've done some thinking, and I am probably just going to release it on my own, rather than making a PR. I'll update soon as I get it out there. Maybe it can be added to the README as a third-party library.
In the meantime, I put together a minimal project using Jersey, Spring REST Docs, Rest Assured and TestNG at: https://github.com/azell/jersey-rest-docs
That will be my alternative until/if Jersey Client support is implemented.
So these past few days, I actually have been working on this. You can have a look at the project. I've done some thinking, and I am probably just going to release it on my own, rather than making a PR. I'll update soon as I get it out there. Maybe it can be added to the README as a third-party library.
Excellent. It looks great. Thank you. I'm more than happy to link to it once you have released something. Let me know if there's anything I can do to help.
This issue seems to have run its course. @psamsotha, please let me know when you've released your library as I'd like to link to it.
@wilkinsona Will do, thanks!
Hey @wilkinsona I just released it. Here again is the link to the project. Thanks again!
I'm a heavy Jersey user, and for testing I use Jersey Test Framework. I like the idea of Spring REST Docs, and was exploring to see if there was a way to integrate it with Jersey Test Framework.
After a few days of hacking, I came up this implementation, along with an example. It's usage is documented in the README. For the most post it tries to keep within the spirit of how both frameworks are meant be used, attempting to make a clean integration.
I am not sure how you feel about adding this support, so I wanted to see what you thought. I'd like to contribute this implementation to the Spring REST Docs project, and work on any improvement ideas you can think of. Or if you like the idea of Jersey support, but don't like the implementation, I'd like to help in figuring out a better implementation :-)