Test.java
1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
*
*/
package com;
import javax.annotation.Resource;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.yoho.activity.common.cache.RedisCache;
import com.yoho.activity.service.ICocacolaService;
import com.yoho.core.common.utils.AES;
/**
* 描述:
*
* @author ping.huang
* 2016年3月15日
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath*:META-INF/spring/spring-mybatis-datasource.xml", "classpath*:META-INF/spring/sprin*.xml"})
public class Test {
@Resource
RedisCache redisCache;
@Resource
ICocacolaService cocacolaService;
@org.junit.Test
public void t() {
try {
cocacolaService.sendNoticeSms("13951882433", "123456781111");
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
String str = "I8vX4MtK";
try {
System.out.println(AES.encrypt("yoho96461qaz2wsx", str));
} catch (Exception e) {
e.printStackTrace();
}
try {
System.out.println(AES.decrypt("yoho96461qaz2wsx", "7jVEde87bLffoTnt6tGxmw=="));
} catch (Exception e) {
e.printStackTrace();
}
}
}