-
Notifications
You must be signed in to change notification settings - Fork 369
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
Introduce strict payload checks. #844
Conversation
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.
LGTM
/** | ||
* {@inheritDoc} | ||
* | ||
* EMPTY message are never intended to have payload! |
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.
"messages are" or "message is" ?
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.
Done
@@ -472,8 +510,15 @@ protected String getPayloadTracingString() { | |||
* | |||
* Provides a fluent API to chain setters. | |||
* | |||
* @param payload the payload as sting | |||
* @param payload the payload as sting. {@code null} or a empty string are |
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.
sting => "string"
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.
Done
@@ -33,7 +33,7 @@ | |||
|
|||
@Test | |||
public void testGetHttpEntity() throws Exception { | |||
Request req = new Request(Code.GET); | |||
Request req = new Request(Code.PUT); |
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.
I maybe don't get the point here, but should we rename the test name too?
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.
the next line calls req.setPayload("payload");
so I changed it.
Yes, the test should be then renamed.
@@ -42,7 +42,7 @@ public void testGetHttpEntity() throws Exception { | |||
|
|||
@Test | |||
public void testGetHttpEntityWithJSON() throws Exception { | |||
Request req = new Request(Code.GET); | |||
Request req = new Request(Code.PUT); |
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.
same as above ?
Check, it message is intended to have payload and thorw exceptions, if not. Overwrite that check by mark a message to have unintended payload. Signed-off-by: Achim Kraus <[email protected]>
Check, it message is intended to have payload and thorw exceptions, if
not. Overwrite that check by mark a message to have unintended payload.
issue #834
Signed-off-by: Achim Kraus [email protected]