完成项目与druid-springboot的集成测试
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
package com.micro.fast.ucenter;
|
||||
|
||||
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.cloud.client.SpringCloudApplication;
|
||||
import org.springframework.cloud.netflix.feign.EnableFeignClients;
|
||||
|
||||
@SpringCloudApplication
|
||||
@EnableFeignClients
|
||||
@MapperScan(basePackages = {"com.micro.fast.ucenter.dao"})
|
||||
@EnableAutoConfiguration(exclude = DruidDataSourceAutoConfigure.class)
|
||||
@EnableAutoConfiguration(exclude = DataSourceAutoConfiguration.class)
|
||||
public class UcenterApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -11,10 +11,10 @@ spring:
|
||||
username: config
|
||||
password: server
|
||||
datasource:
|
||||
username: root
|
||||
password: studyj2e
|
||||
url: jdbc:mysql://127.0.0.1:3317/micro?useUncoide=true&chracterEncoding=utf-8&useSSL=false
|
||||
druid:
|
||||
username: root
|
||||
password: studyj2e
|
||||
url: jdbc:mysql://127.0.0.1:3317/micro?useUncoide=true&chracterEncoding=utf-8&useSSL=false
|
||||
master:
|
||||
initial-size: 19
|
||||
username: root
|
||||
@@ -26,9 +26,6 @@ spring:
|
||||
max-active: 50
|
||||
min-idle: 10
|
||||
max-wait: 1000
|
||||
pool-prepared-statements: true
|
||||
test-on-borrow: true
|
||||
test-while-idle: true
|
||||
time-between-log-stats-millis: 10000
|
||||
min-evictable-idle-time-millis: 100000
|
||||
max-evictable-idle-time-millis: 200000
|
||||
|
||||
@@ -12,6 +12,57 @@ spring:
|
||||
enabled: true
|
||||
username: config
|
||||
password: server
|
||||
datasource:
|
||||
druid:
|
||||
username: root
|
||||
password: studyj2e
|
||||
url: jdbc:mysql://127.0.0.1:3317/micro?useUncoide=true&chracterEncoding=utf-8&useSSL=false
|
||||
master:
|
||||
initial-size: 19
|
||||
username: root
|
||||
password: studyj2e
|
||||
url: jdbc:mysql://127.0.0.1:3317/micro?useUncoide=true&chracterEncoding=utf-8&useSSL=false
|
||||
# 数据源共用基本配置
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
initial-size: 20
|
||||
max-active: 50
|
||||
min-idle: 10
|
||||
max-wait: 1000
|
||||
pool-prepared-statements: true
|
||||
test-on-borrow: true
|
||||
test-while-idle: true
|
||||
time-between-log-stats-millis: 10000
|
||||
min-evictable-idle-time-millis: 100000
|
||||
max-evictable-idle-time-millis: 200000
|
||||
default-auto-commit: true
|
||||
filters: stat,wall
|
||||
# url监控配置
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
url-pattern: /*
|
||||
exclusions: /static/*,/druid/*
|
||||
session-stat-enable: false
|
||||
stat-view-servlet:
|
||||
login-username: micro
|
||||
login-password: fast
|
||||
reset-enable: true
|
||||
allow: 127.0.0.1,172.17.0.1
|
||||
deny: 127.0.0.2
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
# aop拦截监控
|
||||
aop-patterns: com.micro.*
|
||||
# statFilter配置
|
||||
filter:
|
||||
stat:
|
||||
connection-stack-trace-enable: true
|
||||
db-type: mysql
|
||||
enabled: true
|
||||
log-slow-sql: true
|
||||
merge-sql: true
|
||||
slow-sql-millis: 2000
|
||||
aop:
|
||||
proxy-target-class: true
|
||||
eureka:
|
||||
client:
|
||||
serviceUrl:
|
||||
|
||||
Reference in New Issue
Block a user