MessageTest.java
984 Bytes
package com.monitor;
import com.monitor.common.config.SnsMobileConfig;
import com.monitor.common.service.AlarmMsgService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.PropertySource;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* Created by fruwei on 2016/6/22.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
"classpath*:META-INF/spring/spring*.xml"})
@PropertySource({"classpath:jdbc.properties",
"classpath:*.properties"})
public class MessageTest {
@Autowired
public AlarmMsgService alarmMsgService;
@Autowired
private SnsMobileConfig snsMobileConfig;
@Test
public void testSendMsg(){
alarmMsgService.sendSms("java_api","test", snsMobileConfig.getOpsManagerDeveloper());
}
}