Validating Symmetric Encryption Operations in eladmin
This test suite validates the EncryptUtils class functionality in the eladmin project, focusing on symmetric encryption and decryption operations using DES algorithm. The tests ensure reliable data encryption and decryption mechanisms for secure data handling.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
elunez/eladmin
eladmin-common/src/test/java/me/zhengjie/utils/EncryptUtilsTest.java
package me.zhengjie.utils;
import org.junit.jupiter.api.Test;
import static me.zhengjie.utils.EncryptUtils.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class EncryptUtilsTest {
/**
* 对称加密
*/
@Test
public void testDesEncrypt() {
try {
assertEquals("7772841DC6099402", desEncrypt("123456"));
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 对称解密
*/
@Test
public void testDesDecrypt() {
try {
assertEquals("123456", desDecrypt("7772841DC6099402"));
} catch (Exception e) {
e.printStackTrace();
}
}
}