Is it possible to get code coverage reports on endpoints tested with REST-Assured.

1,797 views
Skip to first unread message

Rene Muñiz

unread,
Oct 26, 2015, 4:17:34 PM10/26/15
to REST assured
Anyone has been able to run code coverage reports of any kind on code implementing endpoints tested with REST-Assured? I would like to be able to get code coverage reports on java code that implement end points and run on a web container, and is being tested with REST-Assured. Any advice welcome. Thanks.

Johan Haleby

unread,
Oct 27, 2015, 1:05:34 AM10/27/15
to rest-a...@googlegroups.com
Yes. This is actually not REST Assured specific at all, you can run the tests on the same JVM as the code you're trying to test (this is what I usually do) and then you can just use code coverage tools as normal. If you're testing a remote service (on a different JVM) then you need some special tooling. For example Jacoco has support for starting an agent on a remote JVM to get code coverage. See for example here

Regards,
/Johan

On Mon, Oct 26, 2015 at 9:13 PM, Rene Muñiz <muniz...@gmail.com> wrote:
Anyone has been able to run code coverage reports of any kind on code implementing endpoints tested with REST-Assured? I would like to be able to get code coverage reports on java code that implement end points and run on a web container, and is being tested with REST-Assured. Any advice welcome. Thanks.

--
You received this message because you are subscribed to the Google Groups "REST assured" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mir...@neodonis.com

unread,
Nov 28, 2015, 2:41:13 AM11/28/15
to REST assured
Hi Johan,

Would you please explain how to run tests on the same JVM as the code under test?

Thanks,
mircea

Johan Haleby

unread,
Nov 30, 2015, 1:58:05 AM11/30/15
to rest-a...@googlegroups.com
For example using Spring Boot, see for example this blog.
Message has been deleted
Message has been deleted

Siggi Un

unread,
Jun 5, 2018, 10:26:52 AM6/5/18
to REST assured
Hello,

is it also possible to run tests on the same JVM for Websphere Server?
Does somebody have examples for it?

Best regards,
Siggi

Johan Haleby

unread,
Jun 5, 2018, 10:30:03 AM6/5/18
to rest-a...@googlegroups.com
Yeah it should be possible with something like Arquillian.

Sudip Mitra

unread,
Mar 2, 2023, 7:11:13 AM3/2/23
to REST assured

Hello Mircea,
Were you able to solve generate code coverage for your RestAssured testcases ? I know it is possible with Quarkus. But my project is in Spring boot. 

Thanks
Sudip
Reply all
Reply to author
Forward
0 new messages