package com.example.test;
//
//import org.junit.Before;
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.MediaType;
//import org.springframework.test.context.ContextConfiguration;
//import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
//import org.springframework.test.context.web.WebAppConfiguration;
//import org.springframework.test.web.servlet.MockMvc;
//import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
//import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
//import org.springframework.test.web.servlet.setup.MockMvcBuilders;
//import org.springframework.web.context.WebApplicationContext;
//
//
//import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
//import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
//import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
//
////首先指定Junit的Runner
//@RunWith(SpringJUnit4ClassRunner.class)
//// 指明配置文件所在
//@ContextConfiguration(locations = {"classpath:applicationContext.xml","classpath:spring-mvc.xml"})
//@WebAppConfiguration
public class MockMvcTest {
//
// @Autowired
// private WebApplicationContext webApplicationContext;
//
// private MockMvc mockMvc;
//
// @Before
// public void setUp() throws Exception {
// mockMvc = MockMvcBuilders.webAppContextSetup(this.webApplicationContext).build();
// }
//
//// @Test
//// public void testHelloController1() throws Exception {
//// mockMvc.perform(MockMvcRequestBuilders.get("/hello")
//// .accept(MediaType.APPLICATION_JSON))
//// .andExpect(status().isOk())
//// .andDo(MockMvcResultHandlers.print());
//// }
//
// @Test
// public void testStudentController() throws Exception {
//// mockMvc.perform(MockMvcRequestBuilders.get("/toHello"))
//// .andExpect(status().isOk())
//// .andDo(MockMvcResultHandlers.print());
//
// mockMvc.perform(MockMvcRequestBuilders.get("/list"))
// .andExpect(status().isOk())
// .andDo(MockMvcResultHandlers.print());
//
//// mockMvc.perform(MockMvcRequestBuilders.get("/toAdd"))
//// .andExpect(status().isOk())
//// .andDo(MockMvcResultHandlers.print());
////
//// mockMvc.perform(MockMvcRequestBuilders.post("/add").param("name", "XH")
//// .param("niceName", "XH1995").param("age", "24"))
//// .andExpect(status().isFound())
//// .andDo(MockMvcResultHandlers.print());
////
//// mockMvc.perform(MockMvcRequestBuilders.get("/show").param("id", "147"))
//// .andExpect(status().isOk())
//// .andDo(MockMvcResultHandlers.print());
////
//// mockMvc.perform(MockMvcRequestBuilders.get("/toEdit").param("id", "147"))
//// .andExpect(status().isOk())
//// .andDo(MockMvcResultHandlers.print());
////
//// mockMvc.perform(MockMvcRequestBuilders.post("/edit").param("id", "147")
//// .param("name", "Tom123").param("niceName", "Tom123").param("age", "24"))
//// .andExpect(status().isFound())
//// .andDo(MockMvcResultHandlers.print());
////
//// mockMvc.perform(MockMvcRequestBuilders.get("/delete").param("id", "147"))
//// .andExpect(status().isFound())
//// .andDo(MockMvcResultHandlers.print());
// }
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
spring-boot-jpa-thymeleaf.rar (45个子文件)
spring-boot-jpa-thymeleaf
hs_err_pid7980.log 1KB
pom.xml 2KB
target
test-classes
classes
META-INF
maven
com.xh.sbjt
spring-boot-jpa-thymeleaf
pom.xml 2KB
pom.properties 301B
MANIFEST.MF 378B
application.properties 1KB
templates
edit.html 2KB
add.html 1KB
list.html 1KB
hello.html 57B
detail.html 733B
com
example
dao
StudentDao.class 319B
MyApplication.class 736B
model
Student.class 2KB
test
MockMvcTest.class 292B
controller
HelloController.class 1KB
StudentController.class 3KB
service
StudentService.class 423B
impl
StudentServiceImpl.class 1KB
static
css
bootstrap.css 143KB
jquery.min.js 91KB
js
user.js 1KB
.settings
org.eclipse.m2e.core.prefs 90B
org.eclipse.core.resources.prefs 250B
org.eclipse.jdt.core.prefs 243B
src
test
resources
java
main
resources
application.properties 1KB
templates
edit.html 2KB
add.html 1KB
list.html 1KB
hello.html 57B
detail.html 733B
static
css
bootstrap.css 143KB
jquery.min.js 91KB
js
user.js 1KB
java
com
example
dao
StudentDao.java 300B
model
Student.java 1KB
test
MockMvcTest.java 3KB
MyApplication.java 312B
controller
StudentController.java 2KB
HelloController.java 645B
service
impl
StudentServiceImpl.java 848B
StudentService.java 430B
.project 577B
hs_err_pid2124.log 24KB
.classpath 1KB
共 45 条
- 1
资源评论
PandaCode辉
- 粉丝: 93
- 资源: 29
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- F103-霸道开发板2.8寸电阻触摸屏例程.rar
- Google(高德)地图瓦片python代码下载
- Python实现输出杨辉三角形
- polsarpro官方教程、操作说明 PolSARpro v5.0 Software Training Course
- STM32 TouchGFX的使用二图片显示
- buildx镜像文件,也可以通过网上其他方式获取
- 【中级软件设计师】上午题12-软件工程(2):单元测试、黑盒测试、白盒测试、软件运行与维护
- 免费计算机毕业设计-医院住院管理系统的设计与实现(包含代码+论文)
- tt100k数据转换yolo格式
- 免费计算机毕业设计-学生在线网络考试系统的设计与实现(包含论文+源码)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功