Commit 3042aa33 authored by 技术部-任文超's avatar 技术部-任文超

Merge branch 'master' into 20180105-user-auth

# Conflicts:
#	pom.xml
#	src/main/java/cn/quantgroup/xyqb/Bootstrap.java
#	src/main/resources/META-INF/app.properties
#	src/test/resources/META-INF/app.properties

添加jUnit测试用例Demo
parents f410f1c5 7257e055
......@@ -92,6 +92,7 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- jUnit 5 -->
<dependency>
<groupId>org.junit.jupiter</groupId>
......@@ -248,15 +249,7 @@
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-client</artifactId>
<version>0.10.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cn.quantgroup</groupId>
<artifactId>commons</artifactId>
<version>0.0.5</version>
<scope>compile</scope>
</dependency>
<!-- motan -->
<dependency>
<groupId>com.weibo</groupId>
......@@ -392,6 +385,7 @@
<id>test</id>
<properties>
<profiles.activation>test</profiles.activation>
</properties>
<dependencies>
<dependency>
......
package cn.quantgroup.xyqb;
import cn.quantgroup.tech.shutdown.DefaultSignalHandler;
import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import com.ctrip.framework.apollo.spring.config.ApolloPropertySourceInitializer;
import com.weibo.api.motan.common.MotanConstants;
......@@ -12,20 +11,19 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ApplicationListener;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.scheduling.annotation.EnableAsync;
import sun.misc.Signal;
@ComponentScan(basePackages = {"cn.quantgroup.sms", "cn.quantgroup.xyqb"})
@EnableAutoConfiguration
@SpringBootApplication
@EnableCaching
@EnableApolloConfig(value ={"application", "tech.msg.sdk", "tech.sleuth", "tech.common", "tech.service.urls", "cash.common"})
@EnableApolloConfig
@PropertySource(value = {"classpath:application.properties", "classpath:xyqb.properties"}, ignoreResourceNotFound = true)
@Configuration
@EnableAspectJAutoProxy
@EnableAsync
......@@ -34,6 +32,7 @@ public class Bootstrap {
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(Bootstrap.class);
springApplication.addInitializers(new ApolloPropertySourceInitializer("application", "tech.msg.sdk", "cash.common","tech.service.urls"));
springApplication.addListeners(new ApplicationListener<ContextRefreshedEvent>() {
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
......@@ -42,11 +41,8 @@ public class Bootstrap {
}
});
springApplication.setRegisterShutdownHook(true);
ConfigurableApplicationContext run = springApplication.run(args);
springApplication.run(args);
log.info("server start...");
// 启用平滑退出功能
Signal.handle(new Signal("INT"), new DefaultSignalHandler(run));
//Sentry.init("http://13ef5642903a414c910f8d0e0a2c56ee:8b351ad1abf44de3b4c25f39105fb927@172.16.4.89:9000/6");
}
}
app.id=xyqb-user2
namespace=application,tech.msg.sdk,tech.sleuth,tech.common,tech.service.urls,cash.common
\ No newline at end of file
namespace=application,tech.msg.sdk,cash.common,tech.service.urls
\ No newline at end of file
app.id=xyqb-user2
namespace=application,tech.msg.sdk,tech.sleuth,tech.common,tech.service.urls,cash.common
\ No newline at end of file
namespace=application,tech.msg.sdk,cash.common,tech.service.urls
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment