micronaut-test icon indicating copy to clipboard operation
micronaut-test copied to clipboard

Micronaut Equivalent of Spring's WebTestClient (e.g.: HttpTestClient)

Open driverpt opened this issue 2 years ago • 10 comments

Feature description

Projects with codebases in Spring WebFlux typically use WebTestClient which provides a Fluent API for Integration Testing.

Is it possible to have something with similar API in Micronaut?

Thanks

driverpt avatar May 23 '22 07:05 driverpt

it seems like there are multiple options that fill this space already without needing a new API (restassured, gru etc.)

graemerocher avatar May 25 '22 12:05 graemerocher

Agree, but if you have a lot of tests (and i mean a lot) it's kind of hard to migrate to these new API's.

Also, which one of those Frameworks do you recommend?

driverpt avatar May 25 '22 13:05 driverpt

rest assured seems like a good bet @sdelamo wrote a guide (not yet merged on that) https://github.com/micronaut-projects/micronaut-guides/pull/900

graemerocher avatar Jun 04 '22 08:06 graemerocher

Gru seems like a better bet if you are a Spock user

graemerocher avatar Jun 04 '22 08:06 graemerocher

REST-Assured Guide is published now under https://guides.micronaut.io/latest/micronaut-rest-assured.html

sdelamo avatar Jun 06 '22 04:06 sdelamo

Thanks folks

driverpt avatar Jun 06 '22 07:06 driverpt

REST-Assured Guide is published now under https://guides.micronaut.io/latest/micronaut-rest-assured.html

@sdelamo, do you have an example of how to use REST-assured with kotest?

mplanchant avatar Mar 21 '23 09:03 mplanchant

REST-Assured Guide is published now under https://guides.micronaut.io/latest/micronaut-rest-assured.html

@sdelamo, do you have an example of how to use REST-assured with kotest?

I don't.

sdelamo avatar Apr 27 '23 14:04 sdelamo

What if I want to test only rest api part of my service without persistence? Or without rabbit?

DemiusAcademius avatar Jul 19 '23 17:07 DemiusAcademius

What if I want to test only rest api part of my service without persistence? Or without rabbit?

You can write a test without persistence or security. Disable persistence in your test.

sdelamo avatar Jul 20 '23 10:07 sdelamo