Spring注解测试
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:application.xml")
@Transactional
public class Egptest {
@Autowired
private RestTemplate restTemplate;
@Test
public void aa (){
List<Map<String,Object>> list=new ArrayList<Map<String, Object>>();
Map<String,Object> aa=new HashMap<String, Object>();
aa.put("newWtID","123");
aa.put("oldWtID","1111111111");
Map<String,Object> bb=new HashMap<String, Object>();
bb.put("newWtID","678");
bb.put("oldWtID","14596590");
list.add(aa);
list.add(bb);
String a= JSON.toJSONString(list);
String result = restTemplate.postForObject("******************", a, String.class);
System.out.println(result);
}
}
Spring注解测试的更多相关文章
- [转]Spring 注解总结
原文地址:http://blog.csdn.net/wangshfa/article/details/9712379 一 注解优点?注解解决了什么问题,为什么要使用注解? 二 注解的来龙去脉(历史) ...
- 转-Spring 注解学习手札(七) 补遗——@ResponseBody,@RequestBody,@PathVariable
转-http://snowolf.iteye.com/blog/1628861/ Spring 注解学习手札(七) 补遗——@ResponseBody,@RequestBody,@PathVariab ...
- Spring 注解总结
声明:这是转载的.内容根据网上资料整理.相关链接:http://www.360doc.com/content/10/1118/16/2371584_70449913.shtmlhttp://www.i ...
- 【转】Spring 注解学习手札(超好的springmvc注解教程)
Spring 注解学习手札(一) 构建简单Web应用 Spring 注解学习手札(二) 控制层梳理 Spring 注解学习手札(三) 表单页面处理 Spring 注解学习手札(四) 持久层浅析 Spr ...
- Spring 注解学习手札(七) 补遗——@ResponseBody,@RequestBody,@PathVariable (转)
最近需要做些接口服务,服务协议定为JSON,为了整合在Spring中,一开始确实费了很大的劲,经朋友提醒才发现,SpringMVC已经强悍到如此地步,佩服! 相关参考: Spring 注解学习手札(一 ...
- 基于JDK动态代理和CGLIB动态代理的实现Spring注解管理事务(@Trasactional)到底有什么区别。
基于JDK动态代理和CGLIB动态代理的实现Spring注解管理事务(@Trasactional)到底有什么区别. 我还是喜欢基于Schema风格的Spring事务管理,但也有很多人在用基于@Tras ...
- Spring注解AOP及单元测试junit(6)
2019-03-10/20:19:56 演示:将xml配置方式改为注解方式 静态以及动态代理推荐博客:https://blog.csdn.net/javazejian/article/details/ ...
- 用IntelliJ IDEA 开发Spring+SpringMVC+Mybatis框架 分步搭建三:配置spring并测试
这一部分的主要目的是 配置spring-service.xml 也就是配置spring 并测试service层 是否配置成功 用IntelliJ IDEA 开发Spring+SpringMVC+M ...
- Spring 注解驱动(一)基本使用规则
Spring 注解驱动(一)基本使用规则 Spring 系列目录(https://www.cnblogs.com/binarylei/p/10198698.html) 一.基本使用 @Configur ...
随机推荐
- robotframework之用cmd去执行用例
1.电脑cmd进入 2.在cmd中输入相应的执行命令即可以正常执行 3.执行完成,会显示当前用例执行情况,以及output/log/report的默认保存路径 接下来详细说一下执行不同用例的具体指令, ...
- [Python]_ELVE_centos7安装Python3.7.1与Python2共存
注:该博客转载至PengYunjing博客,加以改动. #0x01 安装依赖环境 yum -y install zlib-devel bzip2-devel openssl-devel ncurses ...
- table动态增加删除
基于网上代码修改实现动态添加表数据行 <!DOCTYPE html> <html lang="cn"> <html> <head> ...
- Django之 静态模板渲染
既可以简单的 django.http.HttpResponse 来把内容显示到网页上,也可以使用渲染模板的方法来显示内容. 说明:代码是基于 Django 1.8,但 Django 1.4 - Dja ...
- Python 入门级报错处理
问题1:Missing parentheses in call to 'print' 原因:因为Python2.X和Python3.X不兼容.我安装的是Python3.X,但是我试图运行的却是Pyth ...
- Idea动态java模板配置
使用全能idea工具可以可以大大的提升开发效率,其中有个特别有用技能跟大家分享一下. 相比大家都用过idea的快速插入代码功能,插入诸如getter,setter还有构造函数生成,做到了只需一键点击就 ...
- Centos6两个镜像文件的合并方法
1.相关目录: /mnt/dvd1和/mnt/dvd2 用于挂载 Centos 镜像 /mnt/dvd3 合并后的镜像文件 /mnt/iso ISO储存 mkdir -p /mnt/dvd1 /mnt ...
- 基于springboot+bootstrap+mysql+redis搭建一套完整的权限架构【六】【引入bootstrap前端框架】
https://blog.csdn.net/linzhefeng89/article/details/78752658 基于springboot+bootstrap+mysql+redis搭建一套完整 ...
- 常用LINQ关键字用法汇总
背景 传统上,针对数据的查询都以简单的字符串表示,而没有编译时类型检查或 IntelliSense 支持.此外,还需要针对每种数据源学习一种不同的查询语言:SQL 数据库.XML 文档.各种 Web ...
- JavaBean找到项目下的文件这里是\WEB-INF\classes\下面的属性文件
String baseinfo="/com/Bean/DBhelp.properties"; filename=getClass().getClassLoader().getRes ...