Skip to content

Commit a888944

Browse files
committed
refactor: Fix imports to satisfy PMD
1 parent fd3e28d commit a888944

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/test/java/com/thealgorithms/ciphers/ColumnarTranspositionCipherTest.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
package com.thealgorithms.ciphers;
22

3-
import static org.junit.jupiter.api.Assertions.assertEquals;
4-
import static org.junit.jupiter.api.Assertions.assertFalse;
5-
import static org.junit.jupiter.api.Assertions.assertNotEquals;
6-
import static org.junit.jupiter.api.Assertions.assertNotNull;
7-
83
import org.junit.jupiter.api.Assertions;
94
import org.junit.jupiter.api.BeforeEach;
105
import org.junit.jupiter.api.Test;
@@ -22,28 +17,28 @@ public void setUp() {
2217
@Test
2318
public void testEncryption() {
2419
String encryptedText = ColumnarTranspositionCipher.encrypt(plaintext, keyword);
25-
assertNotNull(encryptedText, "The encrypted text should not be null.");
26-
assertFalse(encryptedText.isEmpty(), "The encrypted text should not be empty.");
20+
Assertions.assertNotNull(encryptedText, "The encrypted text should not be null.");
21+
Assertions.assertFalse(encryptedText.isEmpty(), "The encrypted text should not be empty.");
2722
// Check if the encrypted text is different from the plaintext
28-
assertNotEquals(plaintext, encryptedText, "The encrypted text should be different from the plaintext.");
23+
Assertions.assertNotEquals(plaintext, encryptedText, "The encrypted text should be different from the plaintext.");
2924
}
3025

3126
@Test
3227
public void testDecryption() {
3328
String encryptedText = ColumnarTranspositionCipher.encrypt(plaintext, keyword);
3429
String decryptedText = ColumnarTranspositionCipher.decrypt();
3530

36-
assertEquals(plaintext.replaceAll(" ", ""), decryptedText.replaceAll(" ", ""), "The decrypted text should match the original plaintext, ignoring spaces.");
37-
assertEquals(encryptedText, ColumnarTranspositionCipher.encrypt(plaintext, keyword), "The encrypted text should be the same when encrypted again.");
31+
Assertions.assertEquals(plaintext.replaceAll(" ", ""), decryptedText.replaceAll(" ", ""), "The decrypted text should match the original plaintext, ignoring spaces.");
32+
Assertions.assertEquals(encryptedText, ColumnarTranspositionCipher.encrypt(plaintext, keyword), "The encrypted text should be the same when encrypted again.");
3833
}
3934

4035
@Test
4136
public void testLongPlainText() {
4237
String longText = "This is a significantly longer piece of text to test the encryption and decryption capabilities of the Columnar Transposition Cipher. It should handle long strings gracefully.";
4338
String encryptedText = ColumnarTranspositionCipher.encrypt(longText, keyword);
4439
String decryptedText = ColumnarTranspositionCipher.decrypt();
45-
assertEquals(longText.replaceAll(" ", ""), decryptedText.replaceAll(" ", ""), "The decrypted text should match the original long plaintext, ignoring spaces.");
46-
assertEquals(encryptedText, ColumnarTranspositionCipher.encrypt(longText, keyword), "The encrypted text should be the same when encrypted again.");
40+
Assertions.assertEquals(longText.replaceAll(" ", ""), decryptedText.replaceAll(" ", ""), "The decrypted text should match the original long plaintext, ignoring spaces.");
41+
Assertions.assertEquals(encryptedText, ColumnarTranspositionCipher.encrypt(longText, keyword), "The encrypted text should be the same when encrypted again.");
4742
}
4843

4944
@Test

0 commit comments

Comments
 (0)