Format code with prettier (#3375)

This commit is contained in:
acbin
2022-10-03 17:23:00 +08:00
committed by GitHub
parent 32b9b11ed5
commit e96f567bfc
464 changed files with 11483 additions and 6189 deletions

View File

@ -6,38 +6,33 @@ import org.junit.jupiter.api.Test;
class BlowfishTest {
Blowfish blowfish = new Blowfish();
Blowfish blowfish = new Blowfish();
@Test
void testEncrypt() {
@Test
void testEncrypt() {
//given
String plainText = "123456abcd132536";
String key = "aabb09182736ccdd";
String expectedOutput = "d748ec383d3405f7";
//given
String plainText = "123456abcd132536";
String key = "aabb09182736ccdd";
String expectedOutput = "d748ec383d3405f7";
//when
String cipherText = blowfish.encrypt(plainText, key);
//then
assertEquals(expectedOutput, cipherText);
//when
String cipherText = blowfish.encrypt(plainText, key);
}
@Test
void testDecrypt() {
//given
String cipherText = "d748ec383d3405f7";
String key = "aabb09182736ccdd";
String expectedOutput = "123456abcd132536";
//when
String plainText = blowfish.decrypt(cipherText, key);
//then
assertEquals(expectedOutput, plainText);
//then
assertEquals(expectedOutput, cipherText);
}
}
@Test
void testDecrypt() {
//given
String cipherText = "d748ec383d3405f7";
String key = "aabb09182736ccdd";
String expectedOutput = "123456abcd132536";
//when
String plainText = blowfish.decrypt(cipherText, key);
//then
assertEquals(expectedOutput, plainText);
}
}