-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
add unit test assertions for Content-Length header #1111
Conversation
WDYT? @carl-mastrangelo |
WDYT? @kyagna |
WDYT? @argha-c |
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.
Couple of minor comments. LGTM otherwise
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class TestUtils { |
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 usages are simple enough that I'd inline them.
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.
@@ -93,6 +98,7 @@ public void testSetBodyGetBody() { | |||
msg.setBody("Hello World!".getBytes()); | |||
final String body = new String(msg.getBody()); | |||
assertEquals("Hello World!", body); | |||
assertContentLength(msg, 12); |
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.
nit: I'd probably extract the String and use the length in assertions for readability. Magic numbers are best avoided.
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.
d869821
to
43b8c95
Compare
Motivation