-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
ReleaseNotes28
Johan Haleby edited this page Dec 18, 2015
·
12 revisions
-
Added support for measuring response time. For example:
long timeInMs = get("/lotto").time()
or using a specific time unit:
long timeInSeconds = get("/lotto").timeIn(SECONDS);
where
SECONDS
is just a standardTimeUnit
. You can also validate it using the validation DSL:when(). get("/lotto"). then(). time(lessThan(2000L)); // Milliseconds
or
when(). get("/lotto"). then(). time(lessThan(2L), SECONDS);
Please note that response time measurement should be performed when the JVM is hot! (i.e. running a response time measurement when only running a single test will yield erroneous results). This is also implemented in the Spring MockMvc module.
-
Lot's of improvements to filters.
- It's now possible to change the request path from a filter, use the FilterableRequestSpecification#path method.
- Added ability to remove parameters from the FilterableRequestSpecification. Use the remove methods such as
removeQueryParam
. - Filters can add and remove path parameters as well as getting undefined path parameter placeholders etc (see javadoc for the methods in
com.jayway.restassured.specification.FilterableRequestSpecification
)
-
Improvements to path parameters. You can now combine unnamed and name path parameters in the same request. Also the error messages are improved when unnamed path parameters are null.
- FilterableRequestSpecification#getPathParams now returns now returns both unnamed and named path parameters (before only named parameters were returned).
- FilterContext#getRequestMethod, use FilterableRequestSpecification#getMethod instead.
- FilterContext#getRequestPath, use FilterableRequestSpecification#getUserDefinedPath instead.
- FilterContext#getRequestURI, use FilterableRequestSpecification#getURI instead.
- FilterContext#getOriginalRequestPath, use FilterableRequestSpecification#getUserDefinedPath instead.
- FilterableRequestSpecification#getRequestContentType, use FilterableRequestSpecification#getContentType instead.
See change log for more details.