[GitHub] [commons-crypto] arturobernalg commented on a change in pull request #114: [CRYPTO-151] Migrate to Junit 5
arturobernalg commented on a change in pull request #114: URL: https://github.com/apache/commons-crypto/pull/114#discussion_r548542582 ## File path: src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java ## @@ -251,13 +249,13 @@ private void byteArrayTest(final String transformation, final byte[] key, final final int n = enc.doFinal(input, 0, input.length, temp, 0); final byte[] cipherText = new byte[n]; System.arraycopy(temp, 0, cipherText, 0, n); - Assert.assertArrayEquals("byte array encryption error.", output, cipherText); + assertArrayEquals( output, cipherText, "byte array encryption error."); Review comment: Done 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: us...@infra.apache.org
[GitHub] [commons-crypto] arturobernalg commented on a change in pull request #114: [CRYPTO-151] Migrate to Junit 5
arturobernalg commented on a change in pull request #114: URL: https://github.com/apache/commons-crypto/pull/114#discussion_r548542504 ## File path: src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java ## @@ -251,13 +249,13 @@ private void byteArrayTest(final String transformation, final byte[] key, final final int n = enc.doFinal(input, 0, input.length, temp, 0); final byte[] cipherText = new byte[n]; System.arraycopy(temp, 0, cipherText, 0, n); - Assert.assertArrayEquals("byte array encryption error.", output, cipherText); + assertArrayEquals( output, cipherText, "byte array encryption error."); temp = new byte[cipherText.length + blockSize]; final int m = dec.doFinal(cipherText, 0, cipherText.length, temp, 0); final byte[] plainText = new byte[m]; System.arraycopy(temp, 0, plainText, 0, m); - Assert.assertArrayEquals("byte array decryption error.", input, plainText); + assertArrayEquals( input, plainText,"byte array decryption error."); Review comment: Done 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: us...@infra.apache.org
[GitHub] [commons-crypto] arturobernalg commented on a change in pull request #114: [CRYPTO-151] - Migrate to Junit 5
arturobernalg commented on a change in pull request #114: URL: https://github.com/apache/commons-crypto/pull/114#discussion_r541778301 ## File path: src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java ## @@ -220,9 +218,7 @@ private void byteBufferTest(final String transformation, final byte[] key, final final byte[] b = new byte[output.remaining()]; output.get(b); final byte[] c = new byte[encResult.remaining()]; - encResult.get(c); - Assert.fail("AES failed encryption - expected " + new String(DatatypeConverter.printHexBinary(b)) - + " got " + new String(DatatypeConverter.printHexBinary(c))); + assertThrows(IllegalArgumentException.class, () -> encResult.get(c)); Review comment: Done ## File path: src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java ## @@ -251,13 +247,13 @@ private void byteArrayTest(final String transformation, final byte[] key, final final int n = enc.doFinal(input, 0, input.length, temp, 0); final byte[] cipherText = new byte[n]; System.arraycopy(temp, 0, cipherText, 0, n); - Assert.assertArrayEquals("byte array encryption error.", output, cipherText); + assertArrayEquals( output, cipherText); Review comment: Done 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: us...@infra.apache.org
[GitHub] [commons-crypto] arturobernalg commented on a change in pull request #114: [CRYPTO-151] - Migrate to Junit 5
arturobernalg commented on a change in pull request #114: URL: https://github.com/apache/commons-crypto/pull/114#discussion_r537060004 ## File path: src/test/java/org/apache/commons/crypto/stream/PositionedCryptoInputStreamTest.java ## @@ -247,7 +250,7 @@ private void testSeekFailed(final String cipherClass, final int position, final getCipher(cipherClass), bufferSize); try { in.seek(position); -Assert.fail("Excepted exception for cannot seek to negative offset."); +fail("Excepted exception for cannot seek to negative offset."); } catch (final IllegalArgumentException iae) { Review comment: Hi @garydgregory Agree with the approach. Changed 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: us...@infra.apache.org