import org.jasypt.encryption.StringEncryptor; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import vc.thinker.ProtocolProxyApplication; /** * @author xieshaojun * @date 2021/8/13 上午 9:32 */ @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = ProtocolProxyApplication.class)
public class IServiceTest {
@Autowired private StringEncryptor stringEncryptor; @Test public void test() { //加密 System.out.println(stringEncryptor.encrypt("tcp://120.79.30.193:1883"));
System.out.println(stringEncryptor.encrypt("thinker")); System.out.println(stringEncryptor.encrypt("123456"));
} }