Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
S
springboot_templ_sys
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ekkoTest
springboot_templ_sys
提交
10c75ffb
提交
10c75ffb
编写于
9月 10, 2019
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rm
上级
dca1b791
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
0 行增加
和
95 行删除
+0
-95
pom.xml
demo-srv/pom.xml
+0
-29
demoMain.java
demo-srv/src/main/java/cn/ibizlab/demo/demoMain.java
+0
-12
DBETController.java
.../java/cn/ibizlab/demo/springboot/rest/DBETController.java
+0
-14
ApplicationTest.java
demo-srv/src/main/test/ApplicationTest.java
+0
-40
未找到文件。
demo-srv/pom.xml
已删除
100644 → 0
浏览文件 @
dca1b791
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
demo-srv
</artifactId>
<name>
demo-srv
</name>
<packaging>
jar
</packaging>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.0.1.RELEASE
</version>
</parent>
<properties>
<junit.version>
4.12
</junit.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
demo-srv/src/main/java/cn/ibizlab/demo/demoMain.java
已删除
100644 → 0
浏览文件 @
dca1b791
package
cn
.
ibizlab
.
demo
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.SpringApplication
;
@SpringBootApplication
public
class
demoMain
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
demoMain
.
class
,
args
);
}
}
\ No newline at end of file
demo-srv/src/main/java/cn/ibizlab/demo/springboot/rest/DBETController.java
已删除
100644 → 0
浏览文件 @
dca1b791
package
cn
.
ibizlab
.
demo
.
springboot
.
rest
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
public
class
DBETController
{
@PostMapping
(
value
=
"/demo/springboot/dbet"
)
public
String
hello
(){
return
String
.
format
(
"您好,您目前正在访问[%s]实体"
,
"DBET"
);
}
}
demo-srv/src/main/test/ApplicationTest.java
已删除
100644 → 0
浏览文件 @
dca1b791
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
cn.ibizlab.demo.demoMain
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.MvcResult
;
import
org.springframework.test.web.servlet.request.MockMvcRequestBuilders
;
import
org.springframework.test.web.servlet.setup.MockMvcBuilders
;
import
org.springframework.web.context.WebApplicationContext
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
demoMain
.
class
)
public
class
ApplicationTest
{
private
MockMvc
mockMvc
;
@Autowired
private
WebApplicationContext
webApplicationContext
;
@Before
public
void
setUp
()
{
mockMvc
=
MockMvcBuilders
.
webAppContextSetup
(
webApplicationContext
).
build
();
}
@Test
public
void
contextLoads
()
{
try
{
MvcResult
mvcResult
=
mockMvc
.
perform
(
MockMvcRequestBuilders
.
post
(
"/demo/springboot/dbet/"
)).
andReturn
();
System
.
out
.
println
(
"----正在调用实体controller----"
);
System
.
out
.
println
(
"controller返回结果为:"
+
mvcResult
.
getResponse
().
getContentAsString
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录