悠然哈哈哈

导航

2013年10月24日 #

Unit Testing of Spring MVC

摘要: 试验1:做的条目不发现首先,我们必须确保我们的应用是工作性质所做条目不发现。我们可以写的测试以确保通过以下步骤:1、配置的模拟对象时抛出一个todonotfoundexception findbyid()方法被调用和请求的待办事项条目ID 1L。2、执行一个GET请求的URL /做/ 1′。3、确认HTTP状态码返回404。4、确保返回的视图名称是“错误/ 404′。5、确保请求转发到URL“/WEB-INF/JSP /错误/ 404 JSP”。6、验证的todoservice接口findbyid()方法被称为只有一次正确的方法参数(1)。7、请确认没有其他的模仿对象的方法都是在这个测试被称为 阅读全文

posted @ 2013-10-24 14:55 悠然886 阅读(470) 评论(0) 推荐(0) 编辑

Unit Testing of Spring MVC Controllers1

摘要: 我们的pom.xml文件相关的部分看起来如下: com.fasterxml.jackson.core jackson-core 2.2.1 test com.fasterxml.jackson.core jackson-databind 2.2.1 test org.hamcrest hamcrest-all 1.3 test junit junit 4.11 test hamcrest-core org.hamcrest org.mockito mockito-core 1.9.5 test org.springframework spring-test 3.... 阅读全文

posted @ 2013-10-24 11:49 悠然886 阅读(360) 评论(0) 推荐(0) 编辑