Java DSL for easy testing of REST services

Overview

REST Assured

Build Status Maven Central Javadoc

Testing and validation of REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of using these languages into the Java domain.

News

  • 2020-12-11: REST Assured 4.3.3 is released with dependency updates and a bug fix. See change log for more details.
  • 2020-12-11: REST Assured 4.2.1 is released in which we've back-ported a fix that is useful if you're stuck with an older version of Groovy. See change log for more details.
  • 2020-11-08: REST Assured 4.3.2 is released with various improvements and bug fixes. See change log for more details.

Older News

Examples

Here's an example of how to make a GET request and validate the JSON or XML response:

get("/lotto").then().assertThat().body("lotto.lottoId", equalTo(5));

Get and verify all winner ids:

get("/lotto").then().assertThat().body("lotto.winners.winnerId", hasItems(23, 54));

Using parameters:

given().
    param("key1", "value1").
    param("key2", "value2").
when().
    post("/somewhere").
then().
    body(containsString("OK"));

Using X-Path (XML only):

given().
    params("firstName", "John", "lastName", "Doe").
when().
    post("/greetMe").
then().
    body(hasXPath("/greeting/firstName[text()='John']")).

Need authentication? REST Assured provides several authentication mechanisms:

given().auth().basic(username, password).when().get("/secured").then().statusCode(200);

Getting and parsing a response body:

// Example with JsonPath
String json = get("/lotto").asString();
List<String> winnerIds = from(json).get("lotto.winners.winnerId");
    
// Example with XmlPath
String xml = post("/shopping").andReturn().body().asString();
Node category = from(xml).get("shopping.category[0]");

REST Assured supports any HTTP method but has explicit support for POST, GET, PUT, DELETE, OPTIONS, PATCH and HEAD and includes specifying and validating e.g. parameters, headers, cookies and body easily.

Documentation

Support and discussion

Join the mailing list at our Google group.

Links

Buy Me A Coffee

Comments
  • [#307] Added async support for Spring MockMvc

    [#307] Added async support for Spring MockMvc

    Initial proposal of an API to add async support for Spring MVC

    example of a spec with async support:

    given().
                    asyncTimeout(10).
                    body("a string").
            when().
                    post("/stringBody").
            then().
                    body(equalTo("a string"));
    

    Where asyncTimeout API looks as follows (example for Specification):

    /**
         * Specify the timeout during which you will wait for async response.
         *
         * @param timeoutInMillis timeout in millis to wait for async response.
         * @return A {@link MockMvcAuthenticationSpecification}.
         */
        MockMvcRequestSpecification asyncTimeout(long timeoutInMillis);
    

    Under the hood what it does is what is described in Spring's API - org.springframework.test.web.servlet.request.MockMvcRequestBuilders#asyncDispatch

    /**
         * Create a {@link RequestBuilder} for an async dispatch from the
         * {@link MvcResult} of the request that started async processing.
         * <p>Usage involves performing one request first that starts async processing:
         * <pre class="code">
         * MvcResult mvcResult = this.mockMvc.perform(get("/1"))
         *  .andExpect(request().asyncStarted())
         *  .andReturn();
         *  </pre>
         * <p>And then performing the async dispatch re-using the {@code MvcResult}:
         * <pre class="code">
         * this.mockMvc.perform(asyncDispatch(mvcResult))
         *  .andExpect(status().isOk())
         *  .andExpect(content().contentType(MediaType.APPLICATION_JSON))
         *  .andExpect(content().string("{\"name\":\"Joe\",\"someDouble\":0.0,\"someBoolean\":false}"));
         * </pre>
         * @param mvcResult the result from the request that started async processing
         */
    

    So the usage to retrieve the result from the async dispatch:

    MvcResult mvcResult;
            if (mockMvcAsyncConfig != null && mockMvcAsyncConfig.isAsync()) {
                MvcResult startedAsyncRequestProcessing = perform.andExpect(request().asyncStarted()).andReturn();
                startedAsyncRequestProcessing.getAsyncResult(mockMvcAsyncConfig.getTimeoutInMs());
                mvcResult = mockMvc.perform(asyncDispatch(startedAsyncRequestProcessing)).andReturn();
            } else {
                mvcResult = perform.andReturn();
            }
            return mvcResult;
    

    where mockMvcAsyncConfig contains the information from the API - long timeoutInMillis.

    I've already tested that in a project where we would need this feature and it seems to be working.

    opened by marcingrzejszczak 32
  • closeIdleConnectionsAfterEachResponse closes the response before consuming is possible

    closeIdleConnectionsAfterEachResponse closes the response before consuming is possible

    Im using the following configuration to reproduce the issue:

    RestAssured.config = RestAssured.config().connectionConfig(new ConnectionConfig().closeIdleConnectionsAfterEachResponse()); RequestSpecification request = given().relaxedHTTPSValidation() .contentType(Constants.XML_CONTENT_TYPE) .auth().basic("usr", "pass"); request .contentType("application/json"); request.accept("application/json"); request.body(...); request.when().post(restURL).then().extract().response().asString();

    The asString() call throws exception: java.net.SocketException: Socket is closed at sun.security.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1520) at sun.security.ssl.AppInputStream.read(AppInputStream.java:95) at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:160) at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:84) at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:273) at org.apache.http.impl.conn.LoggingSessionInputBuffer.readLine(LoggingSessionInputBuffer.java:116) at org.apache.http.impl.io.ChunkedInputStream.getChunkSize(ChunkedInputStream.java:240) at org.apache.http.impl.io.ChunkedInputStream.nextChunk(ChunkedInputStream.java:206) at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:169) at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:238) at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158) at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:117) at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:137) at org.apache.http.conn.EofSensorInputStream$read.call(Unknown Source) at com.jayway.restassured.internal.RestAssuredResponseOptionsGroovyImpl.convertStreamToByteArray(RestAssuredResponseOptionsGroovyImpl.groovy:430) at sun.reflect.GeneratedMethodAccessor158.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:151) at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:102) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:206) at com.jayway.restassured.internal.RestAssuredResponseOptionsGroovyImpl.charsetToString(RestAssuredResponseOptionsGroovyImpl.groovy:482) at com.jayway.restassured.internal.RestAssuredResponseOptionsGroovyImpl$charsetToString$3.callCurrent(Unknown Source) at com.jayway.restassured.internal.RestAssuredResponseOptionsGroovyImpl.asString(RestAssuredResponseOptionsGroovyImpl.groovy:170) at com.jayway.restassured.internal.RestAssuredResponseOptionsGroovyImpl.asString(RestAssuredResponseOptionsGroovyImpl.groovy:166) at com.jayway.restassured.internal.RestAssuredResponseOptionsImpl.asString(RestAssuredResponseOptionsImpl.java:194)

    This happens only with json. application/xml is deserialized correctly.

    Seems like the socket is closed prematurely. Please investigate

    opened by mdzhigarov 30
  • memory leak using JsonPath.from(string).getUUID()

    memory leak using JsonPath.from(string).getUUID()

    Hi.

    I'm performing loadtests using RestAssured 2.9.0 against a REST service. For this, I check the returned response id against a UUID using:

    JsonPath.from(jsonString).getUUID("id");

    I encountered, that during the tests, memory consumption grows and dies in the end with OOME. Tracking down the consumption shows, that many classes of

    org.codehaus.groovy.runtime.metaclass.MetaMethodIndex$Entry

    are loaded and never freed. It seems having something todo with the getUUID() method on RestAssured's side. Just parsing the json string with JsonPath.from() doesn't seem to leak.

    I think it's a Groovy problem, which is tracked here:

    https://issues.apache.org/jira/browse/GROOVY-7683

    But maybe meanwhile you guys could workaround it somehow? Since currently it is unusable for me. I will use a workaround not using getUUID() for now.

    Here a simple snippet to reproduce the problem:

        public static void main(String[] args) throws InterruptedException {
            for (int ci = 0; ci < 100000; ci++) {
                JsonPath.from("{\"id\": \"" + UUID.randomUUID().toString() + "\"}").getUUID("id");
                Thread.sleep(1);
            }
        }
    

    Thanks!

    Just wanted to add: it seems that it happens to all .get* methods - not just .getUUID().

    opened by vguna 27
  • Migrate to Jakarta EE APIs

    Migrate to Jakarta EE APIs

    Hi there,

    is there a roadmap to migrate rest-assured to Jakarta EE APIs? For example the Spring Framework is planning to migrate in the next year:

    Spring Framework 6 and Spring Boot 3 are planned towards a high-end baseline for their general availability in Q4 2022:

    • Java 17+ (from Java 8-17 in the Spring Framework 5.3.x line)
    • Jakarta EE 9+ (from Java EE 7-8 in the Spring Framework 5.3.x line)
    • https://spring.io/blog/2021/09/02/a-java-17-and-jakarta-ee-9-baseline-for-spring-framework-6

    More information from the Eclipse Foundation: https://www.eclipse.org/community/eclipse_newsletter/2020/november/1.php

    opened by thetric 26
  • Packaging 4.0.0 no class def found

    Packaging 4.0.0 no class def found

    After trying to upgrade to 4.0.0 I was hit by a few Class not found exceptions:

    ClassNotFoundException: io.restassured.path.xml.mapper.factory.JAXBObjectMapperFactory
    ClassNotFoundException: io.restassured.path.json.mapper.factory.GsonObjectMapperFactory
    java.lang.NoClassDefFoundError: io/restassured/path/json/mapper/factory/JohnzonObjectMapperFactory
    cannot access TypeRef
    

    From the wiki I should only need this dependency:

    testCompile 'io.rest-assured:rest-assured:4.0.0'
    

    That doesn't seem to be enough

    I've made it work with:

      testCompile group: 'io.rest-assured', name: 'rest-assured', version: '4.0.0'
      testCompile group: 'io.rest-assured', name: 'rest-assured-common', version: '4.0.0'
      testCompile group: 'io.rest-assured', name: 'json-path', version: '4.0.0'
      testCompile group: 'io.rest-assured', name: 'xml-path', version: '4.0.0'
    

    See: https://github.com/hmcts/draft-store/pull/293

    opened by timja 26
  • %2F if specified in path is getting double encoded as %252F iresspective of  setting RestAssured.urlEncodingEnabled=false

    %2F if specified in path is getting double encoded as %252F iresspective of setting RestAssured.urlEncodingEnabled=false

    From [email protected] on June 27, 2012 09:20:47

    What steps will reproduce the problem? RestAssured.urlEncodingEnabled=false given().pathParam("pageUrl", "Product%2F1756%2FMilk-Bone-Flavor-Snacks-Biscuits-for-Dogs"). get("/findItem;pageUrl={pageUrl}")

    OR

    get("/findItem;pageUrl=Product%2F1756%2FMilk-Bone-Flavor-Snacks-Biscuits-for-Dogs;sortby=true;test=abc123")

    The server is receiving the pageURl as "Product%252F1756%252FMilk-Bone-Flavor-Snacks-Biscuits-for-Dogs" . you can clearly see %2F is getting double encoded as %252F.

    if you use any of the above methods you can see when the pageUrl parameter passed to the server is double encoded. There is no way to pass a matrixparam to a rest service which contains "/" . if possible add support for matrixparam as well, so that we will be able to test rest services which takes multiple matrixparam as input. What is the expected output? What do you see instead? i should have seen pageUrl=Product%2F1756%2FMilk-Bone-Flavor-Snacks-Biscuits-for-Dogs at the server. Bu i see its coming as Product%252F1756%252FMilk-Bone-Flavor-Snacks-Biscuits-for-Dogs What version of the product are you using? On what operating system? 1.6.2 on Windows 7 Please provide any additional information below.

    Original issue: http://code.google.com/p/rest-assured/issues/detail?id=181

    Priority-Medium imported bug 
    opened by johanhaleby 26
  • OAuth 1.0 POST with ContentType.URLENC.

    OAuth 1.0 POST with ContentType.URLENC.

    As I understand it is bug. Code like this:

    given()
                    .auth()
                    .oauth("customer_key", "customer_secret", "", "", OAuthSignature.HEADER)
                    .contentType(ContentType.URLENC)
                    .param("email", "[email protected]")
                    .param("password", "password")
            .when()
                    .post("localhost/accounts")
            .then()
                    .log()
                    .all();
    

    gives me: "message": "Request signature mismatch." So signature generate incorrect.

    opened by aivancioglo 25
  • Can't PUT to server byte[] with content type set

    Can't PUT to server byte[] with content type set

    From [email protected] on February 14, 2012 02:04:43

    What steps will reproduce the problem? 1. Run the following code:

    byte[] bytes = "Some Text".getBytes();
    given()
      .contentType("application/vnd.myitem+xml")
      .body(bytes)
    .put("http://localhost:8080/some/path/myitem/1");
    

    (my real binary payload is larger which is partly why it's binary, but this demonstrates the principle) What is the expected output? What do you see instead? I expect a PUT to the server and corresponding response, instead I get the following stack trace:

    No signature of method: com.jayway.restassured.internal.encoderregistry.RestAssuredEncoderRegistry.encodeForm() is applicable for argument types: ([B) values: [[83, 111, 109, 101, 32, 84, 101, 120, 116]] Possible solutions: encodeForm(java.lang.String), encodeForm(java.util.Map), encodeJSON(java.lang.Object), encodeStream(java.lang.Object), encodeText(java.lang.Object), encodeXML(java.lang.Object)

    groovy.lang.MissingMethodException: No signature of method: com.jayway.restassured.internal.encoderregistry.RestAssuredEncoderRegistry.encodeForm() is applicable for argument types: ([B) values: [[83, 111, 109, 101, 32, 84, 101, 120, 116]] Possible solutions: encodeForm(java.lang.String), encodeForm(java.util.Map), encodeJSON(java.lang.Object), encodeStream(java.lang.Object), encodeText(java.lang.Object), encodeXML(java.lang.Object) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:54) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:59) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.setGroovyObjectProperty(ScriptBytecodeAdapter.java:533) at com.jayway.restassured.internal.RequestSpecificationImpl$_sendHttpRequest_closure10.doCall(RequestSpecificationImpl.groovy:800) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:273) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886) at groovy.lang.Closure.call(Closure.java:282) at groovy.lang.Closure.call(Closure.java:295) at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:425) at groovyx.net.http.HTTPBuilder.request(HTTPBuilder.java:376) at groovyx.net.http.HTTPBuilder$request.call(Unknown Source) at com.jayway.restassured.internal.RequestSpecificationImpl.sendHttpRequest(RequestSpecificationImpl.groovy:794) at com.jayway.restassured.internal.RequestSpecificationImpl.this$2$sendHttpRequest(RequestSpecificationImpl.groovy) at com.jayway.restassured.internal.RequestSpecificationImpl$this$2$sendHttpRequest.callCurrent(Unknown Source) at com.jayway.restassured.internal.RequestSpecificationImpl.sendRequest(RequestSpecificationImpl.groovy:717) at com.jayway.restassured.internal.RequestSpecificationImpl.this$2$sendRequest(RequestSpecificationImpl.groovy) at com.jayway.restassured.internal.RequestSpecificationImpl$this$2$sendRequest.call(Unknown Source) at com.jayway.restassured.internal.filter.RootFilter.filter(RootFilter.groovy:28) at com.jayway.restassured.filter.Filter$filter.call(Unknown Source) at com.jayway.restassured.internal.filter.FilterContextImpl.next(FilterContextImpl.groovy:45) at com.jayway.restassured.filter.FilterContext$next.call(Unknown Source) at com.jayway.restassured.internal.RequestSpecificationImpl.invokeFilterChain(RequestSpecificationImpl.groovy:608) at com.jayway.restassured.internal.RequestSpecificationImpl$invokeFilterChain.callCurrent(Unknown Source) at com.jayway.restassured.internal.RequestSpecificationImpl.applyPathParamsAndSendRequest(RequestSpecificationImpl.groovy:957) at com.jayway.restassured.internal.RequestSpecificationImpl.this$2$applyPathParamsAndSendRequest(RequestSpecificationImpl.groovy) at com.jayway.restassured.internal.RequestSpecificationImpl$this$2$applyPathParamsAndSendRequest.callCurrent(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:157) at com.jayway.restassured.internal.RequestSpecificationImpl.put(RequestSpecificationImpl.groovy:124) at com.myorg.project.test.IntegrationTest.testThatBreaks(IntegrationTest.java:100) at net.sf.antcontrib.logic.TryCatchTask.execute(TryCatchTask.java:207) What version of the product are you using? On what operating system? version 1.5 Windows Please provide any additional information below. I also have set global BASIC auth and a baseURI that I'm overriding here, plus a RestArsured.registerParser for my content type

    Original issue: http://code.google.com/p/rest-assured/issues/detail?id=160

    Priority-Medium 1.7 imported bug 
    opened by johanhaleby 25
  • Introduce thread local context for Request and Response

    Introduce thread local context for Request and Response

    We have faced with issue (feature) that default RestAssured values (uri, path, auth) could not be unique per execution thread. That is our current solution for that issue - remove static from RestAssured methods and variables, wrap it with ThreadLocal. That's not the best solution as for me, but it simply works. Opened to discussion and any ideas.

    opened by RocketRaccoon 24
  • Does it support 2 legged call in Oauth

    Does it support 2 legged call in Oauth

    I see that Oauth method accepts Consumer Key, Secret, Token and Token Secret. How can I make a 2 legged call ? Will it work if I pass Token and Token secret as empty strings?

    opened by coding-yogi 24
  • Found duplicate (but equal) classes in multiple 3.2.0 artifacts

    Found duplicate (but equal) classes in multiple 3.2.0 artifacts

    I upgraded my project from io.rest-assured:rest-assured version 3.1.1 to 3.2.0 and my builds started complaining of duplicate classes present in multiple artifacts:

    [WARNING] Found duplicate (but equal) classes in [io.rest-assured:json-path:3.2.0, io.rest-assured:rest-assured-common:3.2.0, io.rest-assured:rest-assured:3.2.0, io.rest-assured:xml-path:3.2.0]:
    [WARNING]   io.restassured.exception.PathException
    [WARNING]   io.restassured.internal.assertion.AssertParameter
    [WARNING]   io.restassured.internal.assertion.Assertion
    [WARNING]   io.restassured.internal.assertion.AssertionSupport
    [WARNING]   io.restassured.internal.assertion.EndToEndQuoteFragmentEscaper
    [WARNING]   io.restassured.internal.assertion.GetAtPathFragmentEscaper
    [WARNING]   io.restassured.internal.assertion.HyphenQuoteFragmentEscaper
    [WARNING]   io.restassured.internal.assertion.PathFragmentEscaper
    [WARNING]   io.restassured.internal.classpath.ClassPathResolver
    [WARNING]   io.restassured.internal.mapper.ObjectDeserializationContextImpl
    [WARNING]   io.restassured.internal.path.ObjectConverter
    [WARNING]   io.restassured.mapper.DataToDeserialize
    [WARNING]   io.restassured.mapper.ObjectDeserializationContext
    [WARNING]   io.restassured.mapper.factory.ObjectMapperFactory
    [WARNING]   io.restassured.mapper.resolver.ObjectMapperResolver
    [WARNING] Found duplicate (but equal) classes in [io.rest-assured:json-path:3.2.0, io.rest-assured:rest-assured:3.2.0]:
    [WARNING]   io.restassured.internal.path.json.ConfigurableJsonSlurper
    [WARNING]   io.restassured.internal.path.json.JSONAssertion
    [WARNING]   io.restassured.internal.path.json.JsonPrettifier
    [WARNING]   io.restassured.internal.path.json.mapping.JsonObjectDeserializer
    [WARNING]   io.restassured.internal.path.json.mapping.JsonPathGsonObjectDeserializer
    [WARNING]   io.restassured.internal.path.json.mapping.JsonPathJackson1ObjectDeserializer
    [WARNING]   io.restassured.internal.path.json.mapping.JsonPathJackson2ObjectDeserializer
    [WARNING]   io.restassured.mapper.factory.DefaultGsonObjectMapperFactory
    [WARNING]   io.restassured.mapper.factory.DefaultJackson1ObjectMapperFactory
    [WARNING]   io.restassured.mapper.factory.DefaultJackson2ObjectMapperFactory
    [WARNING]   io.restassured.mapper.factory.GsonObjectMapperFactory
    [WARNING]   io.restassured.mapper.factory.Jackson1ObjectMapperFactory
    [WARNING]   io.restassured.mapper.factory.Jackson2ObjectMapperFactory
    [WARNING]   io.restassured.path.json.JsonPath
    [WARNING]   io.restassured.path.json.config.JsonParserType
    [WARNING]   io.restassured.path.json.config.JsonPathConfig
    [WARNING]   io.restassured.path.json.exception.JsonPathException
    [WARNING]   io.restassured.path.json.mapping.JsonPathObjectDeserializer
    [WARNING] Found duplicate (but equal) classes in [io.rest-assured:rest-assured:3.2.0, io.rest-assured:xml-path:3.2.0]:
    [WARNING]   io.restassured.internal.path.xml.GroovyNodeSerializer
    [WARNING]   io.restassured.internal.path.xml.NodeBase
    [WARNING]   io.restassured.internal.path.xml.NodeChildrenImpl
    [WARNING]   io.restassured.internal.path.xml.NodeImpl
    [WARNING]   io.restassured.internal.path.xml.XMLAssertion
    [WARNING]   io.restassured.internal.path.xml.XmlEntity
    [WARNING]   io.restassured.internal.path.xml.XmlPrettifier
    [WARNING]   io.restassured.internal.path.xml.XmlRenderer
    [WARNING]   io.restassured.internal.path.xml.mapping.XmlObjectDeserializer
    [WARNING]   io.restassured.internal.path.xml.mapping.XmlPathJaxbObjectDeserializer
    [WARNING]   io.restassured.mapper.factory.DefaultJAXBObjectMapperFactory
    [WARNING]   io.restassured.mapper.factory.JAXBObjectMapperFactory
    [WARNING]   io.restassured.path.xml.XmlPath
    [WARNING]   io.restassured.path.xml.config.XmlParserType
    [WARNING]   io.restassured.path.xml.config.XmlPathConfig
    [WARNING]   io.restassured.path.xml.element.Node
    [WARNING]   io.restassured.path.xml.element.NodeChildren
    [WARNING]   io.restassured.path.xml.element.PathElement
    [WARNING]   io.restassured.path.xml.exception.XmlPathException
    [WARNING]   io.restassured.path.xml.mapping.XmlPathObjectDeserializer
    

    Is this intentional?

    CC // @larrysteinke

    opened by markkolich 23
  • Bump spring-webmvc from 4.3.23.RELEASE to 5.2.20.RELEASE in /modules/spring-mock-mvc

    Bump spring-webmvc from 4.3.23.RELEASE to 5.2.20.RELEASE in /modules/spring-mock-mvc

    Bumps spring-webmvc from 4.3.23.RELEASE to 5.2.20.RELEASE.

    Release notes

    Sourced from spring-webmvc's releases.

    v5.2.20.RELEASE

    :star: New Features

    • Restrict access to property paths on Class references #28262
    • Improve diagnostics in SpEL for large array creation #28257

    v5.2.19.RELEASE

    :star: New Features

    • Declare serialVersionUID on DefaultAopProxyFactory #27785
    • Use ByteArrayDecoder in DefaultClientResponse::createException #27667

    :lady_beetle: Bug Fixes

    • ProxyFactoryBean getObject called before setInterceptorNames, silently creating an invalid proxy [SPR-7582] #27817
    • Possible NPE in Spring MVC LogFormatUtils #27783
    • UndertowHeadersAdapter's remove() method violates Map contract #27593
    • Fix assertion failure messages in DefaultDataBuffer.checkIndex() #27577

    :notebook_with_decorative_cover: Documentation

    • Lazy annotation throws exception if non-required bean does not exist #27660
    • Incorrect Javadoc in [NamedParameter]JdbcOperations.queryForObject methods regarding exceptions #27581
    • DefaultResponseErrorHandler update javadoc comment #27571

    :hammer: Dependency Upgrades

    • Upgrade to Reactor Dysprosium-SR25 #27635
    • Upgrade to Log4j2 2.16.0 #27825

    v5.2.18.RELEASE

    :star: New Features

    • Enhance DefaultResponseErrorHandler to allow logging complete error response body #27558
    • DefaultMessageListenerContainer does not log an error/warning when consumer tasks have been rejected #27457

    :lady_beetle: Bug Fixes

    • Performance impact of con.getContentLengthLong() in AbstractFileResolvingResource.isReadable() downloading huge jars to check component length #27549
    • Performance impact of ResourceUrlEncodingFilter on HttpServletResponse#encodeURL #27548
    • Avoid duplicate JCacheOperationSource bean registration in #27547
    • Non-escaped closing curly brace in RegEx results in initialization error on Android #27502
    • Proxy generation with Java 17 fails with "Cannot invoke "Object.getClass()" because "cause" is null" #27498
    • ConcurrentReferenceHashMap's entrySet violates the Map contract #27455

    :hammer: Dependency Upgrades

    • Upgrade to Reactor Dysprosium-SR24 #27526

    v5.2.17.RELEASE

    ... (truncated)

    Commits
    • cfa701b Release v5.2.20.RELEASE
    • 996f701 Refine PropertyDescriptor filtering
    • 90cfde9 Improve diagnostics in SpEL for large array creation
    • 94f52bc Upgrade to Artifactory Resource 0.0.17
    • d4478ba Upgrade Java versions in CI image
    • 136e6db Upgrade Ubuntu version in CI images
    • 8f1f683 Upgrade Java versions in CI image
    • ce2367a Upgrade to Log4j2 2.17.1
    • acf7823 Next development version (v5.2.20.BUILD-SNAPSHOT)
    • 1a03ffe Upgrade to Log4j2 2.16.0
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
    dependencies java 
    opened by dependabot[bot] 0
  • Bump spring-webmvc from 4.3.23.RELEASE to 5.2.20.RELEASE in /examples/spring-mvc-webapp

    Bump spring-webmvc from 4.3.23.RELEASE to 5.2.20.RELEASE in /examples/spring-mvc-webapp

    Bumps spring-webmvc from 4.3.23.RELEASE to 5.2.20.RELEASE.

    Release notes

    Sourced from spring-webmvc's releases.

    v5.2.20.RELEASE

    :star: New Features

    • Restrict access to property paths on Class references #28262
    • Improve diagnostics in SpEL for large array creation #28257

    v5.2.19.RELEASE

    :star: New Features

    • Declare serialVersionUID on DefaultAopProxyFactory #27785
    • Use ByteArrayDecoder in DefaultClientResponse::createException #27667

    :lady_beetle: Bug Fixes

    • ProxyFactoryBean getObject called before setInterceptorNames, silently creating an invalid proxy [SPR-7582] #27817
    • Possible NPE in Spring MVC LogFormatUtils #27783
    • UndertowHeadersAdapter's remove() method violates Map contract #27593
    • Fix assertion failure messages in DefaultDataBuffer.checkIndex() #27577

    :notebook_with_decorative_cover: Documentation

    • Lazy annotation throws exception if non-required bean does not exist #27660
    • Incorrect Javadoc in [NamedParameter]JdbcOperations.queryForObject methods regarding exceptions #27581
    • DefaultResponseErrorHandler update javadoc comment #27571

    :hammer: Dependency Upgrades

    • Upgrade to Reactor Dysprosium-SR25 #27635
    • Upgrade to Log4j2 2.16.0 #27825

    v5.2.18.RELEASE

    :star: New Features

    • Enhance DefaultResponseErrorHandler to allow logging complete error response body #27558
    • DefaultMessageListenerContainer does not log an error/warning when consumer tasks have been rejected #27457

    :lady_beetle: Bug Fixes

    • Performance impact of con.getContentLengthLong() in AbstractFileResolvingResource.isReadable() downloading huge jars to check component length #27549
    • Performance impact of ResourceUrlEncodingFilter on HttpServletResponse#encodeURL #27548
    • Avoid duplicate JCacheOperationSource bean registration in #27547
    • Non-escaped closing curly brace in RegEx results in initialization error on Android #27502
    • Proxy generation with Java 17 fails with "Cannot invoke "Object.getClass()" because "cause" is null" #27498
    • ConcurrentReferenceHashMap's entrySet violates the Map contract #27455

    :hammer: Dependency Upgrades

    • Upgrade to Reactor Dysprosium-SR24 #27526

    v5.2.17.RELEASE

    ... (truncated)

    Commits
    • cfa701b Release v5.2.20.RELEASE
    • 996f701 Refine PropertyDescriptor filtering
    • 90cfde9 Improve diagnostics in SpEL for large array creation
    • 94f52bc Upgrade to Artifactory Resource 0.0.17
    • d4478ba Upgrade Java versions in CI image
    • 136e6db Upgrade Ubuntu version in CI images
    • 8f1f683 Upgrade Java versions in CI image
    • ce2367a Upgrade to Log4j2 2.17.1
    • acf7823 Next development version (v5.2.20.BUILD-SNAPSHOT)
    • 1a03ffe Upgrade to Log4j2 2.16.0
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
    dependencies java 
    opened by dependabot[bot] 0
  • Bump spring-webmvc from 4.3.23.RELEASE to 5.2.20.RELEASE in /examples/scala-mock-mvc-example

    Bump spring-webmvc from 4.3.23.RELEASE to 5.2.20.RELEASE in /examples/scala-mock-mvc-example

    Bumps spring-webmvc from 4.3.23.RELEASE to 5.2.20.RELEASE.

    Release notes

    Sourced from spring-webmvc's releases.

    v5.2.20.RELEASE

    :star: New Features

    • Restrict access to property paths on Class references #28262
    • Improve diagnostics in SpEL for large array creation #28257

    v5.2.19.RELEASE

    :star: New Features

    • Declare serialVersionUID on DefaultAopProxyFactory #27785
    • Use ByteArrayDecoder in DefaultClientResponse::createException #27667

    :lady_beetle: Bug Fixes

    • ProxyFactoryBean getObject called before setInterceptorNames, silently creating an invalid proxy [SPR-7582] #27817
    • Possible NPE in Spring MVC LogFormatUtils #27783
    • UndertowHeadersAdapter's remove() method violates Map contract #27593
    • Fix assertion failure messages in DefaultDataBuffer.checkIndex() #27577

    :notebook_with_decorative_cover: Documentation

    • Lazy annotation throws exception if non-required bean does not exist #27660
    • Incorrect Javadoc in [NamedParameter]JdbcOperations.queryForObject methods regarding exceptions #27581
    • DefaultResponseErrorHandler update javadoc comment #27571

    :hammer: Dependency Upgrades

    • Upgrade to Reactor Dysprosium-SR25 #27635
    • Upgrade to Log4j2 2.16.0 #27825

    v5.2.18.RELEASE

    :star: New Features

    • Enhance DefaultResponseErrorHandler to allow logging complete error response body #27558
    • DefaultMessageListenerContainer does not log an error/warning when consumer tasks have been rejected #27457

    :lady_beetle: Bug Fixes

    • Performance impact of con.getContentLengthLong() in AbstractFileResolvingResource.isReadable() downloading huge jars to check component length #27549
    • Performance impact of ResourceUrlEncodingFilter on HttpServletResponse#encodeURL #27548
    • Avoid duplicate JCacheOperationSource bean registration in #27547
    • Non-escaped closing curly brace in RegEx results in initialization error on Android #27502
    • Proxy generation with Java 17 fails with "Cannot invoke "Object.getClass()" because "cause" is null" #27498
    • ConcurrentReferenceHashMap's entrySet violates the Map contract #27455

    :hammer: Dependency Upgrades

    • Upgrade to Reactor Dysprosium-SR24 #27526

    v5.2.17.RELEASE

    ... (truncated)

    Commits
    • cfa701b Release v5.2.20.RELEASE
    • 996f701 Refine PropertyDescriptor filtering
    • 90cfde9 Improve diagnostics in SpEL for large array creation
    • 94f52bc Upgrade to Artifactory Resource 0.0.17
    • d4478ba Upgrade Java versions in CI image
    • 136e6db Upgrade Ubuntu version in CI images
    • 8f1f683 Upgrade Java versions in CI image
    • ce2367a Upgrade to Log4j2 2.17.1
    • acf7823 Next development version (v5.2.20.BUILD-SNAPSHOT)
    • 1a03ffe Upgrade to Log4j2 2.16.0
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
    dependencies java 
    opened by dependabot[bot] 0
  • Bump spring-webflux from 5.1.0.RELEASE to 5.2.20.RELEASE in /modules/spring-web-test-client

    Bump spring-webflux from 5.1.0.RELEASE to 5.2.20.RELEASE in /modules/spring-web-test-client

    Bumps spring-webflux from 5.1.0.RELEASE to 5.2.20.RELEASE.

    Release notes

    Sourced from spring-webflux's releases.

    v5.2.20.RELEASE

    :star: New Features

    • Restrict access to property paths on Class references #28262
    • Improve diagnostics in SpEL for large array creation #28257

    v5.2.19.RELEASE

    :star: New Features

    • Declare serialVersionUID on DefaultAopProxyFactory #27785
    • Use ByteArrayDecoder in DefaultClientResponse::createException #27667

    :lady_beetle: Bug Fixes

    • ProxyFactoryBean getObject called before setInterceptorNames, silently creating an invalid proxy [SPR-7582] #27817
    • Possible NPE in Spring MVC LogFormatUtils #27783
    • UndertowHeadersAdapter's remove() method violates Map contract #27593
    • Fix assertion failure messages in DefaultDataBuffer.checkIndex() #27577

    :notebook_with_decorative_cover: Documentation

    • Lazy annotation throws exception if non-required bean does not exist #27660
    • Incorrect Javadoc in [NamedParameter]JdbcOperations.queryForObject methods regarding exceptions #27581
    • DefaultResponseErrorHandler update javadoc comment #27571

    :hammer: Dependency Upgrades

    • Upgrade to Reactor Dysprosium-SR25 #27635
    • Upgrade to Log4j2 2.16.0 #27825

    v5.2.18.RELEASE

    :star: New Features

    • Enhance DefaultResponseErrorHandler to allow logging complete error response body #27558
    • DefaultMessageListenerContainer does not log an error/warning when consumer tasks have been rejected #27457

    :lady_beetle: Bug Fixes

    • Performance impact of con.getContentLengthLong() in AbstractFileResolvingResource.isReadable() downloading huge jars to check component length #27549
    • Performance impact of ResourceUrlEncodingFilter on HttpServletResponse#encodeURL #27548
    • Avoid duplicate JCacheOperationSource bean registration in #27547
    • Non-escaped closing curly brace in RegEx results in initialization error on Android #27502
    • Proxy generation with Java 17 fails with "Cannot invoke "Object.getClass()" because "cause" is null" #27498
    • ConcurrentReferenceHashMap's entrySet violates the Map contract #27455

    :hammer: Dependency Upgrades

    • Upgrade to Reactor Dysprosium-SR24 #27526

    v5.2.17.RELEASE

    ... (truncated)

    Commits
    • cfa701b Release v5.2.20.RELEASE
    • 996f701 Refine PropertyDescriptor filtering
    • 90cfde9 Improve diagnostics in SpEL for large array creation
    • 94f52bc Upgrade to Artifactory Resource 0.0.17
    • d4478ba Upgrade Java versions in CI image
    • 136e6db Upgrade Ubuntu version in CI images
    • 8f1f683 Upgrade Java versions in CI image
    • ce2367a Upgrade to Log4j2 2.17.1
    • acf7823 Next development version (v5.2.20.BUILD-SNAPSHOT)
    • 1a03ffe Upgrade to Log4j2 2.16.0
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
    dependencies java 
    opened by dependabot[bot] 0
  • Redirect to Log4j2

    Redirect to Log4j2

    Hello, we have managed to redirected most of the logs of RestAssured to Log4j2 except for the response because the new ByteArrayOutputStream() is hardcoded so we cannot override it as done elsewhere:

    RequestSpecification ifValidationFails(LogDetail logDetail, boolean shouldPrettyPrint) {
      ByteArrayOutputStream baos = new ByteArrayOutputStream()
      PrintStream ps = new PrintStream(baos)
      logRepository.registerRequestLog(baos)
      logWith(logDetail, shouldPrettyPrint, ps)
    }
    

    do you have any proposition or does it require a change on your side?

    Thanks a lot for the attention :)

    opened by blackat 1
Owner
REST Assured
Java DSL for easy testing of REST services
REST Assured
Cucumber DSL for testing RESTful Web Services

cukes-rest takes simplicity of Cucumber and provides bindings for HTTP specification. As a sugar on top, cukes-rest adds steps for storing and using r

C.T.Co 100 Oct 18, 2022
JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.

pact-jvm JVM implementation of the consumer driven contract library pact. From the Ruby Pact website: Define a pact between service consumers and prov

Pact Foundation 962 Dec 31, 2022
Java testing framework for testing pojo methods

Java testing framework for testing pojo methods. It tests equals, hashCode, toString, getters, setters, constructors and whatever you report in issues ;)

Piotr JoĊ„ski 48 Aug 23, 2022
Automation Tests (REST-API with REST-ASSURED examples)

Automation Tests (REST-API with REST-ASSURED examples) Technology Stack IDEA Java Junit5 Gradle Selenide Allure Jenkins Rest-Assured See details: src/

null 3 Apr 11, 2022
Awaitility is a small Java DSL for synchronizing asynchronous operations

Testing asynchronous systems is hard. Not only does it require handling threads, timeouts and concurrency issues, but the intent of the test code can

Awaitility 3.3k Dec 31, 2022
Awaitility is a small Java DSL for synchronizing asynchronous operations

Testing asynchronous systems is hard. Not only does it require handling threads, timeouts and concurrency issues, but the intent of the test code can

Awaitility 3.3k Jan 2, 2023
A tool for mocking HTTP services

WireMock - a web service test double for all occasions Key Features HTTP response stubbing, matchable on URL, header and body content patterns Request

Tom Akehurst 5.3k Dec 31, 2022
WireMock - A tool for mocking HTTP services

WireMock only uses log4j in its test dependencies. Neither the thin nor standalone JAR depends on or embeds log4j, so you can continue to use WireMock 2.32.0 without any risk of exposue to the recently discovered vulnerability.

null 5.3k Dec 31, 2022
A modern testing and behavioural specification framework for Java 8

Introduction If you're a Java developer and you've seen the fluent, modern specification frameworks available in other programming languages such as s

Richard Warburton 250 Sep 12, 2022
A programmer-oriented testing framework for Java.

JUnit 4 JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. For more infor

JUnit 8.4k Jan 4, 2023
Advanced Java library for integration testing, mocking, faking, and code coverage

Codebase for JMockit 1.x releases - Documentation - Release notes How to build the project: use JDK 1.8 or newer use Maven 3.6.0 or newer; the followi

The JMockit Testing Toolkit 439 Dec 9, 2022
ScalaTest is a free, open-source testing toolkit for Scala and Java programmers

ScalaTest is a free, open-source testing toolkit for Scala and Java programmers.

ScalaTest 1.1k Dec 26, 2022
Isolated MinIO container management for Java code testing

TestContainers for MinIO MinIO support for the test containers project. Installation Unfortunately, TestContainers for MinIO is not available in any p

Olsi Qose 3 Sep 30, 2022
Toolkit for testing multi-threaded and asynchronous applications

ConcurrentUnit A simple, zero-dependency toolkit for testing multi-threaded code. Supports Java 1.6+. Introduction ConcurrentUnit was created to help

Jonathan Halterman 406 Dec 30, 2022
Randomized Testing (Core JUnit Runner, ANT, Maven)

RANDOMIZED TESTING ================== JUnit test runner and plugins for running JUnit tests with pseudo-randomness. See the following for more infor

null 167 Dec 26, 2022
Captures log entries for unit testing purposes

LogCaptor Install with maven <dependency> <groupId>io.github.hakky54</groupId> <artifactId>logcaptor</artifactId> <version>2.4.0</version>

null 215 Jan 1, 2023
The Enterprise-ready testing and specification framework.

Spock Framework Spock is a BDD-style developer testing and specification framework for Java and Groovy applications. To learn more about Spock, visit

Spock Framework 3.3k Jan 5, 2023
TestNG testing framework

Documentation available at TestNG's main web site. Release Notes 7.4.0 7.3.0 7.1.0 7.0.0 Need help? Before opening a new issue, did you ask your quest

Cedric Beust 1.8k Jan 5, 2023