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

Manual Test Failing in Micronaut MongoDB Guide #1300

Open
johnfilo-kmart opened this issue Jul 18, 2023 · 4 comments
Open

Manual Test Failing in Micronaut MongoDB Guide #1300

johnfilo-kmart opened this issue Jul 18, 2023 · 4 comments

Comments

@johnfilo-kmart
Copy link

johnfilo-kmart commented Jul 18, 2023

Expected Behavior

Running manual tests from the micronaut provided guide show work without error.

Guide: https://guides.micronaut.io/latest/micronaut-data-mongodb-synchronous-maven-java.html

Actual Behaviour

Running the manual tests from the micronaut provided guide throw an error.

Guide: https://guides.micronaut.io/latest/micronaut-data-mongodb-synchronous-maven-java.html

Steps To Reproduce

  1. Download https://guides.micronaut.io/latest/micronaut-data-mongodb-synchronous-maven-java.zip and unzip
  2. Run ./mvnw test and this works fine
  3. Run ./mvnw rn:run to start application, then run manual tests:

curl -d '{"name":"Pear"}'
-H "Content-Type: application/json"
-X POST http://localhost:8080/fruits

Get Error:
{"_links":{"self":[{"href":"/fruits","templated":false}]},"_embedded":{"errors":[{"message":"Required argument [Fruit fruit] not specified","path":"/fruit"}]},"message":"Bad Request"}%

Environment Information

  • OS: MacOS 12.2.1
  • JDK: corretto64-17.0.7
  • Micronaut Version: 4.0.0

Example Application

https://guides.micronaut.io/latest/micronaut-data-mongodb-synchronous-maven-java.zip

Version

4.0.0

@radovanradic
Copy link

Just a note, until guides are fixed. In order to fix the app, need to add @Body annotation from io.micronaut.http.annotation package to the Fruit fruit parameter in save and update methods.

@radovanradic
Copy link

I think this belongs into micronaut-guides repository since PR will be created there so will move it there.

@radovanradic radovanradic transferred this issue from micronaut-projects/micronaut-data Jul 18, 2023
@johnfilo-kmart
Copy link
Author

Thanks @radovanradic

@johnfilo-kmart
Copy link
Author

Adding the @Body as you suggested worked, thank you!

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

2 participants