gpt4 book ai didi

kotlin - "Receiver class does not define or inherit an implementation"与 RestAssured 4.3.0

转载 作者:行者123 更新时间:2023-12-02 12:19:22 25 4
gpt4 key购买 nike

运行以下 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.2.0 测试运行成功。

最佳答案

就我而言,它似乎是 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com