micronaut-projects / micronaut-test

Repository for Test Related Utilities for Micronaut
Apache License 2.0
83 stars 61 forks source link

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

Open driverpt opened 2 years ago

driverpt commented 2 years ago

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

graemerocher commented 2 years ago

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

driverpt commented 2 years ago

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?

graemerocher commented 2 years ago

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 commented 2 years ago

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

sdelamo commented 2 years ago

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

driverpt commented 2 years ago

Thanks folks

mplanchant commented 1 year ago

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?

sdelamo commented 1 year ago

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.

DemiusAcademius commented 1 year ago

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

sdelamo commented 1 year ago

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.