Lors de l'exécution de l'opération suivante WebTestClient
test
@Test
fun `test accepted response`() {
standaloneSetup(SapKontraktEndpointV1())
given()
.body(
"{}", ObjectMapperType.JACKSON_2
)
.contentType(ContentType.JSON)
.`when`()
.post("/api/v1/kontrakt/erstellen")
.then()
.statusCode(202)
}
L'erreur suivante se produit alors :
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)
Avec la version 4.2.0, le test est réussi.