- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
运行以下 WebTestClient
时测试
@Test
fun `test accepted response`() {
standaloneSetup(SapKontraktEndpointV1())
given()
.body(
"{}", ObjectMapperType.JACKSON_2
)
.contentType(ContentType.JSON)
.`when`()
.post("/api/v1/kontrakt/erstellen")
.then()
.statusCode(202)
}
java.lang.AbstractMethodError: Receiver class io.restassured.internal.mapping.ObjectMapperSerializationContextImpl does not define or inherit an implementation of the resolved method 'abstract void setProperty(java.lang.String, java.lang.Object)' of interface groovy.lang.GroovyObject.
at org.codehaus.groovy.runtime.InvokerHelper.setProperty(InvokerHelper.java:213)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.setProperty(ScriptBytecodeAdapter.java:496)
at io.restassured.internal.mapping.ObjectMapping.serializationContext(ObjectMapping.groovy:275)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:149)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:100)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:55)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:196)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:224)
at io.restassured.internal.mapping.ObjectMapping.serialize(ObjectMapping.groovy:123)
at io.restassured.module.webtestclient.internal.WebTestClientRequestSpecificationImpl.body(WebTestClientRequestSpecificationImpl.java:357)
最佳答案
就我而言,它似乎是 4.3.0 中的一个错误,因为 4.2.0 测试运行良好。
关于kotlin - "Receiver class does not define or inherit an implementation"与 RestAssured 4.3.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61508353/
我正在尝试编写一个用于 API 测试的 BDD 框架。导入静态 io.restassured.RestAssured.*;不工作。另外,当我使用给定()关键字时它会抛出错误。我已经添加了各自的 Mav
您好,我在使用放心 4.1.1 时无法解决该错误。我的 Eclipse IDE 中的库。我已经在我的 pom.xml 文件中添加了放心库,但错误仍未解决。 我尝试从 https://mvnreposi
运行测试时出现以下错误。我正在尝试将 API 响应打印到文件,但是测试失败并引发错误。调用的响应采用 JSON 格式,采用 GZIP 格式。任何想法和想法都将不胜感激。 错误: io.restassu
我正在尝试使用 Java 的 RestAssured API 进行 OKTA 身份验证。有问题的身份验证类型是多因素的,虽然我总是能够在 Google Chrome 中成功进行此身份验证,但在 Res
我正在尝试设置最新版本的 spring cloud contract。但是总是抛异常,无法初始化。我的毕业典礼看起来像这样。我可以在外部库中看到,2.9.0 是可见的。 dependencies {
前言 不知道大家的项目是否都有对接口API进行自动化测试,反正像我们这种小公司是没有的。由于最近一直被吐槽项目质量糟糕,只能研发自己看看有什么接口测试方案。那么在本文中,我将探索如何使用 R
我有 RESTAssured 的测试(!)代码,它检查 REST 端点是否返回 0 作为状态代码; given() .contentType(CONTENT_TYPE_APP
stackoverflowians:) 我已经停止使用 Gmail API 进行 Post 调用了。一直在尝试使用createDraft和createLabel。现在我想我已经找到了如何正确执行此操作
我正在尝试使用 RestAPI 编程获取多个 URI。所有的GET请求都需要基本授权 我使用了一个基类,在其中定义了 RequestSpecification,如下所示(以避免每次运行测试时都使用授权
假设我有以下模型: @Data class Model { private String someField; private String otherField; } 以及 Rest
我在测试中通过的对象 @Data public class UserRequest { @JsonProperty("name") private final String name; @JsonPr
在rest-assured中使用requestSpecBuilder,我在日志文件中获取日志两次。如何禁用此功能? @BeforeClass public void initSpec() {
(注意:我已经看到多个关于“Jackson 提示无法识别的属性”主题的问题得到了回答,但我没有找到专门使用 RestAssured 的对象映射器的问题) 我有一个 RestAssured 测试,它有效
我正在尝试配置并发送如下所示的多部分请求: ------boundary Content-Disposition: form-data; name="before"; filename="blob"
我有一些使用 RestAssured 的 Java 测试。对于许多测试,given() 和when() 参数不同,但then() 部分是相同的并且由多个assertThat() 语句组成。如何将 th
我正在使用放心为我的微服务编写集成测试。我有一个像这样的 Json 有效负载,它是从它返回的。 { "sessionQuestions":[ { "id":1272
有人可以让我了解如何验证响应中的项目列表吗?假设响应如下所示, { "store":{ "book":[ { "author":"N
我们有 REST 网络服务。它对 JSON 数据表示进行操作。我想提供功能测试。我打算使用 RestAssured framework .它提供了可理解的方法来测试输出 json 的正确性。 示例,g
我想默认为所有 RestAssured 响应和请求启用日志记录。 这是我的做法: RestAssured.requestSpecification = new RequestSpecBuilder()
有没有办法将整个JSON路径数据转换为Java中的字符串? 我正在处理 API,它们的响应采用 JSON 格式。通过 Postman/WireShark 很容易理解 JSON 结构,但我试图通过 Ja
我是一名优秀的程序员,十分优秀!