-
Notifications
You must be signed in to change notification settings - Fork 149
Empty body test #2497
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
Empty body test #2497
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughThe changes consolidate test fixture data from external resource files into the test class as static string constants and add a helper method for constructing requests. A new test case for empty POST body handling is introduced, and two external test resource files are deleted. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request needs "/ok-to-test" from an authorized committer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
core/src/test/java/com/predic8/membrane/core/http/RequestTest.javacore/src/test/resources/request-chunked-soap.msgcore/src/test/resources/request-post.msg
💤 Files with no reviewable changes (2)
- core/src/test/resources/request-chunked-soap.msg
- core/src/test/resources/request-post.msg
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-06-18T12:03:09.931Z
Learnt from: rrayst
Repo: membrane/api-gateway PR: 1906
File: core/src/test/java/com/predic8/membrane/core/openapi/validators/JsonSchemaTestSuiteTests.java:0-0
Timestamp: 2025-06-18T12:03:09.931Z
Learning: The mediaType method in the Request class throws jakarta.mail.internet.ParseException, not java.text.ParseException, making the jakarta.mail.internet.ParseException import necessary and correct in JsonSchemaTestSuiteTests.java.
Applied to files:
core/src/test/java/com/predic8/membrane/core/http/RequestTest.java
📚 Learning: 2025-09-19T11:12:26.787Z
Learnt from: predic8
Repo: membrane/api-gateway PR: 2156
File: core/src/main/java/com/predic8/membrane/core/openapi/validators/QueryParameterValidator.java:129-131
Timestamp: 2025-09-19T11:12:26.787Z
Learning: Request.get().path() in com.predic8.membrane.core.openapi.model.Request preserves the query string portion of the path, so URIFactory.createWithoutException(request.getPath()).getQuery() correctly extracts query parameters.
Applied to files:
core/src/test/java/com/predic8/membrane/core/http/RequestTest.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (java)
🔇 Additional comments (3)
core/src/test/java/com/predic8/membrane/core/http/RequestTest.java (3)
18-18: LGTM!The
@NotNullannotation import is correctly used in the helper methodgetRequest()to indicate the method never returns null.
97-99: LGTM! Well-designed helper method.The
getRequest()helper correctly normalizes text block strings into HTTP-compliant messages by removing indentation, stripping trailing whitespace, and converting line endings to CRLF format.
146-154: LGTM! Good test coverage for empty POST body.The new test correctly validates that the request parser handles POST requests with
Content-Length: 0and an empty body. The assertions appropriately verify the method, URI, body existence, and zero length.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.