Test.java 1.21 KB
/**
 * 
 */
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();
		}
	}
	
	
}