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

Function Server TCK: ControllerConstraintHandlerTest failing because of getBody() #925

Open
andriy-dmytruk opened this issue Jun 14, 2024 · 0 comments

Comments

@andriy-dmytruk
Copy link
Contributor

Issue description

The Server TCK was added in this PR: #920.

Currently some of the ControllerConstraintHandlerTest is failing.
The reason for failure are these lines: https://github.com/micronaut-projects/micronaut-core/blob/39818ada8f3cabbe17ee4d61e19e13e4e0d1fef4/http-server-tck/src/main/java/io/micronaut/http/server/tck/tests/constraintshandler/ControllerConstraintHandlerTest.java#L180-L196

The error handler consumes an HttpRequest<?> but then expects it to be one of CredentialsWithoutNullabilityAnnotation, CredentialsWithNullable, or CredentialsWithNonNull. While these are the bodies that are supposed to be consumed by original operations (non error-handlers), I don't see a particular reason why they should be provided to the error handler.

Since the original operations bind the bodies first, a way of fixing this would be to store this body when it is bound:
image
This does not seem like a good solution, though and I think the TCK should be changed unless this is documented behavior. Something like this would be sufficient in this case:
image

cc @graemerocher @yawkat

graemerocher pushed a commit that referenced this issue Jun 18, 2024
This PR adds Micronaut Server TCK for Oracle Cloud Function HTTP.

Currently, 10 of 188 tests (5%) fail.

Fixes:

* Making the request implementation mutable to support filters.
* Allow empty response when an exception is thrown micronaut-servlet#737
* Add support for parsing form data and support empty values in the form data.
* Support binding publisher when there is only one element.
* Support binding body parts for JSON case (so binding JSON properties).
* Fix reading cookies from headers.

Created issues:

Function Server TCK: Body has already been consumed exception #921
Function Server TCK: ControllerConstraintHandlerTest failing because of getBody() #925
Function Server TCK: RequestFilterTest failing #926
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant