- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一直在尝试为我编写的基于 Spring MVC 的 Rest Services 找到一个简单的通用单元测试框架。
我一直在网上搜索并将其缩小到:
最佳答案
Rest-Assured 在 Java 中测试 REST 服务的框架已被其他框架所接受。具有 BDD 风格的流畅界面,它也易于阅读测试脚本,学习曲线最小。
作为最终用户,我使用这个框架来验证 REST 服务,并且更容易为它们实现测试脚本。因此,我不能对 REST-assured 的 Spring MVC 部分发表太多评论。
但是,此博客 post为您提供有关 RestAssured v2.2 的更多详细信息,其中包括 spring-mock-mvc
建立在 MockMVC 之上的模块通过 REST 保证提供 BDD 风格的流畅界面风格。该博客文章还警告说:
何时不使用:
RestAssuredMockMvc
is not to be considered a complete replacement to vanillaMockMvc
since it contains more specific features coupled to Spring MVC. For example right now there’s no first class support for things like flash attributes and principals. You can how ever add those by using an interceptor. Standard REST Assured also supports a lot of different authentication schemes and filters which are not available in theRestAssuredMockMvc
API. Another reason for why you may want to use the standard REST Assured API is if it’s important to your organization to test the REST API in a real container (for example if you’ve configured authentication or authorization in a container specific manner) or if you’re using JAX-RS (or any other framework regardless of language).
关于RestFuse vs Rest Assured vs MockMVC Rest 服务单元测试框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34646021/
我有一个关于 Rest Assured 的问题,它是否只适用于 Java 测试?或者我可以将它与 C# 一起使用? 谢谢 最佳答案 编辑:顺便说一句,似乎也有一个 .net 实现: https://g
我需要针对以下 json 响应正文中“字段”(即“同意”、“失败计数”)下的值进行提取和/或断言: { "next": null, "previous": null, "results": [
我的示例 Web 服务返回以下 XML。 Wrong ID 2 以下测试通过。 response.then().body("errorResponse.errorId", Matchers.is
我正在尝试使用 REST Assured检查我的服务器返回的 HTML 文档的一些属性。安SSCCE问题的证明如下: import static com.jayway.restassured.path
io.rest-assured 和 jayway rest-assured 有什么区别?我应该使用哪个框架进行 restfull web 服务测试? 最佳答案 REST Assured 有一个新的组
我有一个 JSON 响应: ["alice", "jason", "steve", "alex"] 那么在使用的时候放心测试: when(). get("/names"). then()
我从未使用过JUnit或其他测试框架。我所知道的是如何发展休息服务。我最近看到了REST有保证的框架来测试REST API。但是我发现的所有文章如下所示。但是我不知道如何传递请求xml,如何获得响应以
我有一个 Spring Boot 应用程序,一个 Controller 将根据 post 参数重定向到一个页面。 我正在创建想要断言重定向页面的测试用例 但是我没能从放心的响应中得到重定向的html
我想放心地提取请求的URL,我尝试使用given().log().all()它正在记录所有内容,我只想提取我的请求 URI。 最佳答案 given().log().uri() 将在控制台中打印请求 u
我正在寻找一种在“放心”中实现条件验证的方法。假设我得到的响应正文为 { "id": 1, "accounts": [ { "accountType": "Type1", "pro
我正在尝试使用 REST 保证来测试我的登录/注销功能。是否有可能进行 REST 保证测试,发布登录然后发布注销?如果没有,我该如何正确测试? 最佳答案 就发两个后()与一个 断言()/期望() :
有没有办法让我拥有多个 Rest Assured Client 实例? 我必须测试需要的两个不同端点: 不同的序列化器和反序列化器。 不同的标题和内容类型。 我怎样才能做到这一点?我认为 Rest A
我有用于按名称查找用户的 REST,对于某些搜索词,它会返回在名字或姓氏中包含该词的用户。 GET /search/joe 返回 json 数组: [ {"id": 1, "firstName":
无法在我的端点 URL 中使用查询 我尝试过使用 .queryParams() 但它似乎不起作用。我收到以下错误 java.lang.IllegalArgumentException: Invalid
我有一个断言值的 API 测试。目前它从 Excel 读取行,然后在正常的 for 循环中循环。如果值确实匹配,则效果非常好。 但是,如果断言失败,则测试将以堆栈跟踪 AssertionError 结
我正在使用 Rest assured,我想知道如何更改运行它的数据库? 目前,我正在针对我的应用程序进行测试,该应用程序连接到保存我所有数据的数据库,但速度很慢。我要放心使用我的测试数据库。我怎样才能
在这种情况下有人可以帮助我吗: 当我调用这个服务时,http://restcountries.eu/rest/v1/,我得到了几个国家的信息。 但是,当我想获取任何特定国家/地区的信息(例如芬兰)时,
假设我有一个 Java Person类: class Person { String name; String email; } 使用 REST Assured,您可以反序列化这个 J
如何在放心的 API 测试中处理上传文件? 比如你必须使用 post(/url) 然后在特定参数上传文件。? 最佳答案 希望这会有所帮助,对我来说很好 given(). multiPa
在通过 RestAssured API 调用后,我从 REST API 获得了响应到 Response 对象。 响应主体是json,我想从中获取特定的键值? 代码如下 Response res = g
我是一名优秀的程序员,十分优秀!