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);


}

上一篇:linux下debug工具


下一篇:[转]linux下iftop工具的安装与使用详解(图文)——实时的网络流量,监控TCP/IP连接(单机)