-
Notifications
You must be signed in to change notification settings - Fork 212
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
Use assertArrayEquals and add proper error messages to asserts #864
base: next
Are you sure you want to change the base?
Use assertArrayEquals and add proper error messages to asserts #864
Conversation
Much nicer, isn’t it? 😁 |
@@ -160,10 +164,10 @@ public void testSuccessfulRoundTripInPlace() throws GeneralSecurityException { | |||
byte[] buffer = Hex.decode(plainText[i]); | |||
byte[] plaintextCopy = buffer.clone(); | |||
crypt.encrypt(buffer, 0, buffer.length); | |||
assertTrue(!Arrays.equals(buffer, plaintextCopy)); | |||
assertThat((Object) buffer, not(equalTo(plaintextCopy))); |
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.
That cast is not necessary.
assertNotEquals(ciphertext1, ciphertext2); | ||
assertNotEquals(ciphertext1, ciphertext3); | ||
assertNotEquals(ciphertext2, ciphertext3); | ||
assertThat((Object) ciphertext1, not(equalTo(ciphertext2))); |
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.
And neither are these casts. 🙂
plaintext.position(header); | ||
ciphertext.position(header); | ||
assertTrue(!Arrays.equals(ciphertextBuf, copyCiphertextBuf)); | ||
assertThat((Object) ciphertextBuf, not(equalTo(copyCiphertextBuf))); |
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.
More unnecessary casting.
No description provided.