smallchill
6 years ago
6 changed files with 110 additions and 0 deletions
@ -0,0 +1,23 @@
|
||||
import com.example.demo.DemoApplication; |
||||
import org.junit.Test; |
||||
import org.junit.runner.RunWith; |
||||
import org.springblade.core.test.BladeBootTest; |
||||
import org.springblade.core.test.BladeSpringRunner; |
||||
import org.springframework.boot.test.context.SpringBootTest; |
||||
|
||||
/** |
||||
* Blade单元测试 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@RunWith(BladeSpringRunner.class) |
||||
@SpringBootTest(classes = DemoApplication.class) |
||||
@BladeBootTest(appName = "blade-demo", profile = "test", enableLoader = true) |
||||
public class BladeDemoTest { |
||||
|
||||
@Test |
||||
public void contextLoads() { |
||||
System.out.println("测试~~~~~~"); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,46 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package launcher; |
||||
|
||||
import org.springblade.common.constant.CommonConstant; |
||||
import org.springblade.core.auto.service.AutoService; |
||||
import org.springblade.core.launch.service.LauncherService; |
||||
import org.springframework.boot.builder.SpringApplicationBuilder; |
||||
|
||||
import java.util.Properties; |
||||
|
||||
/** |
||||
* 启动参数拓展 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@AutoService(LauncherService.class) |
||||
public class DemoTestLauncherServiceImpl implements LauncherService { |
||||
|
||||
@Override |
||||
public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) { |
||||
Properties props = System.getProperties(); |
||||
props.setProperty("spring.cloud.nacos.discovery.server-addr", CommonConstant.NACOS_DEV_ADDR); |
||||
props.setProperty("spring.cloud.nacos.config.server-addr", CommonConstant.NACOS_DEV_ADDR); |
||||
props.setProperty("spring.cloud.sentinel.transport.dashboard", CommonConstant.SENTINEL_DEV_ADDR); |
||||
} |
||||
|
||||
@Override |
||||
public int getOrder() { |
||||
return 10; |
||||
} |
||||
} |
@ -0,0 +1,10 @@
|
||||
#服务器端口 |
||||
server: |
||||
port: 8200 |
||||
|
||||
#数据源配置 |
||||
spring: |
||||
datasource: |
||||
url: ${blade.datasource.test.url} |
||||
username: ${blade.datasource.test.username} |
||||
password: ${blade.datasource.test.password} |
@ -0,0 +1,21 @@
|
||||
#mybatis-plus配置 |
||||
mybatis-plus: |
||||
mapper-locations: classpath:com/example/**/mapper/*Mapper.xml |
||||
#实体扫描,多个package用逗号或者分号分隔 |
||||
typeAliasesPackage: com.example.**.entity |
||||
|
||||
#swagger扫描路径配置 |
||||
swagger: |
||||
base-packages: |
||||
- org.springbalde |
||||
- com.example |
||||
|
||||
#oss配置 |
||||
oss: |
||||
enable: true |
||||
name: minio |
||||
tenant-mode: false |
||||
endpoint: http://127.0.0.1:9000 |
||||
access-key: D99KGE6ZTQXSATTJWU24 |
||||
secret-key: QyVqGnhIQQE734UYSUFlGOZViE6+ZlDEfUG3NjhJ |
||||
bucket-name: bladex |
Loading…
Reference in new issue