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

add unit test assertions for Content-Length header #1111

Merged
merged 2 commits into from Nov 29, 2021

Conversation

sullis
Copy link
Contributor

@sullis sullis commented Oct 10, 2021

Motivation

  • verify that the Content-Length header is set correctly

@sullis
Copy link
Contributor Author

sullis commented Oct 12, 2021

WDYT? @carl-mastrangelo

@sullis
Copy link
Contributor Author

sullis commented Oct 16, 2021

WDYT? @kyagna

@carl-mastrangelo
Copy link
Contributor

@argha-c

@sullis
Copy link
Contributor Author

sullis commented Oct 22, 2021

WDYT? @argha-c

Copy link
Collaborator

@argha-c argha-c left a 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 {
Copy link
Collaborator

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.

Copy link
Contributor Author

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);
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@argha-c argha-c merged commit 0f56f68 into Netflix:master Nov 29, 2021
argha-c pushed a commit to argha-c/zuul that referenced this pull request Mar 22, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants