You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by GitBox <gi...@apache.org> on 2021/06/14 08:00:41 UTC

[GitHub] [httpcomponents-client] arturobernalg commented on a change in pull request #307: Replace assert calls by simpler but equivalent calls.

arturobernalg commented on a change in pull request #307:
URL: https://github.com/apache/httpcomponents-client/pull/307#discussion_r650513539



##########
File path: httpclient5/src/test/java/org/apache/hc/client5/http/auth/TestCredentials.java
##########
@@ -84,9 +84,9 @@ public void testUsernamePasswordCredentialsHashCode() {
         final UsernamePasswordCredentials creds3 = new UsernamePasswordCredentials(
                 "name", "otherpwd".toCharArray());
 
-        Assert.assertTrue(creds1.hashCode() == creds1.hashCode());
+        Assert.assertEquals(creds1.hashCode(), creds1.hashCode());
         Assert.assertTrue(creds1.hashCode() != creds2.hashCode());

Review comment:
       I think it's more clear. There is a specific assertions for compare the two object

##########
File path: httpclient5/src/test/java/org/apache/hc/client5/http/auth/TestCredentials.java
##########
@@ -84,9 +84,9 @@ public void testUsernamePasswordCredentialsHashCode() {
         final UsernamePasswordCredentials creds3 = new UsernamePasswordCredentials(
                 "name", "otherpwd".toCharArray());
 
-        Assert.assertTrue(creds1.hashCode() == creds1.hashCode());
+        Assert.assertEquals(creds1.hashCode(), creds1.hashCode());
         Assert.assertTrue(creds1.hashCode() != creds2.hashCode());

Review comment:
       Ok, reverted.
   TY

##########
File path: httpclient5/src/test/java/org/apache/hc/client5/http/auth/TestCredentials.java
##########
@@ -124,15 +124,15 @@ public void testNTCredentialsHashCode() {
         final NTCredentials creds9 = new NTCredentials(
                 "name","pwd".toCharArray(), "somehost", null);
 
-        Assert.assertTrue(creds1.hashCode() == creds1.hashCode());
+        Assert.assertEquals(creds1.hashCode(), creds1.hashCode());
         Assert.assertTrue(creds1.hashCode() != creds2.hashCode());

Review comment:
       Ok, reverted.
   TY

##########
File path: httpclient5/src/test/java/org/apache/hc/client5/http/auth/TestCredentials.java
##########
@@ -84,9 +84,9 @@ public void testUsernamePasswordCredentialsHashCode() {
         final UsernamePasswordCredentials creds3 = new UsernamePasswordCredentials(
                 "name", "otherpwd".toCharArray());
 
-        Assert.assertTrue(creds1.hashCode() == creds1.hashCode());
+        Assert.assertEquals(creds1.hashCode(), creds1.hashCode());
         Assert.assertTrue(creds1.hashCode() != creds2.hashCode());

Review comment:
       Sorry. My mistake. I leave it as it was




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org