michael-o commented on a change in pull request #307:
URL:
https://github.com/apache/httpcomponents-client/pull/307#discussion_r650512766
##########
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:
Same here
##########
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:
Why didn#t you modify this one?
##########
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:
`assertNotEquals()` isn't clear?
##########
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 am confused now. I have reverted the first line but left the third
one? It is now even more inconsistent. My question was: Why can the second line
use `assertNotEquals()`?
--
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]