Commit Graph

408 Commits

Author SHA1 Message Date
Andy Wilkinson
2db7ab5e71 Start work on 1.2.0 2016-07-25 11:08:36 +01:00
Andy Wilkinson
d919238023 Update the samples following the release of 1.1.1.RELEASE 2016-07-25 11:06:49 +01:00
Spring Buildmaster
8a91f17054 Next development version 2016-07-25 09:24:28 +00:00
Andy Wilkinson
6c6054178e Upgrade tests and samples to use Spring Boot 1.3.6.RELEASE 2016-07-22 14:41:45 +01:00
Andy Wilkinson
3ec945fe58 Make it clearer how to use RestDocumentationResultHandler.document
Closes gh-255
2016-07-22 14:30:09 +01:00
Andy Wilkinson
3dceea8bb5 Document the tableCellContent Mustache lambda
Closes gh-251
2016-07-22 14:19:13 +01:00
Andy Wilkinson
78318775e0 Cause a failure when field's documented and actual types do not match
Closes gh-276
2016-07-22 13:20:44 +01:00
Andy Wilkinson
86c2310b90 Improve message when fields cannot be documented due to empty body
Closes gh-278
2016-07-22 11:44:43 +01:00
Andy Wilkinson
6131730621 Merge pull request #279 from mle-enso
* gh-279:
  Polish "Improve documention on how to use .adoc snippets"
  Improve documention on how to use .adoc snippets
2016-07-22 10:56:32 +01:00
Andy Wilkinson
9c97c8b9bf Polish "Improve documention on how to use .adoc snippets"
See gh-279
2016-07-22 10:51:11 +01:00
mle
eb46eaa3c5 Improve documention on how to use .adoc snippets
Closes gh-279
2016-07-22 10:47:13 +01:00
Andy Wilkinson
f77864b094 Merge pull request #280 from Johnny Lim
* gh-280:
  Remove unnecessary Host header set in UriModifyingOperationPreprocessor
2016-07-22 10:18:24 +01:00
Johnny Lim
19d7337e26 Remove unnecessary Host header set in UriModifyingOperationPreprocessor
Closes gh-280
2016-07-22 10:17:58 +01:00
Andy Wilkinson
4f00cebaae Adopt the new CLA signing process 2016-07-11 10:47:14 +01:00
Andy Wilkinson
a3159b6f1c Update README to link to restdocsext-jersey third-party extension 2016-07-05 15:37:22 +01:00
Andy Wilkinson
0a0136ca58 Move spring-webmvc dependency to where it's needed
Previously, spring-restdocs-core had a dependency on spring-webmvc
however it only used classes from spring-web. This commit moves
the spring-webmvc dependency from spring-restdocs-core to
spring-restdocs-mockmvc where it's needed. It's now in the runtime
scope (rather than compile) as it's not needed at compile time but
is needed at runtime by the MockMvc support in spring-test.

Closes gh-273
2016-07-05 12:49:17 +01:00
Andy Wilkinson
417547e61a Support more types of content in RestAssuredRequestConverter
Previously, RestAssuredRequestConverter only supported request and
request part content that was null, a String or a byte[]. This was
particularly problematic for multipart requests as RestAssured performs
some internal conversion which meant that, no matter what the when a
byte[] was provided it was wrapped in a ByteArrayInputStream meaning
that the converter could not read it.

The commit improves RestAssuredRequestConverter so that it will now
convert File content and InputStream content where the stream supported
reset().

Closes gh-252
2016-06-28 11:17:37 +01:00
Andy Wilkinson
61226b5619 Merge pull request #268 from Jennifer Strater
* gh-268:
  Add README to Grails sample
2016-06-27 16:25:10 +01:00
Jennifer Strater
42613bf3f9 Add README to Grails sample
Closes gh-254
Closes gh-268
2016-06-27 16:25:04 +01:00
Andy Wilkinson
0540f98de8 Merge pull request #266 from Jennifer Strater
* gh-266:
  Split samples table into three tables grouped by type
2016-06-27 16:10:42 +01:00
Jennifer Strater
a1d5d75c4e Split samples table into three tables grouped by type
Closes gh-266
2016-06-27 16:08:36 +01:00
Andy Wilkinson
30254ba6d5 Merge pull request #271 from Johnny Lim
* gh-271:
  Correct javadoc in LinksSnippet
2016-06-24 09:30:42 +01:00
Johnny Lim
c6f20f2138 Correct javadoc in LinksSnippet
Closes gh-271
2016-06-24 09:30:31 +01:00
Andy Wilkinson
8ca1dfa1ad Improve handling of requests with both parameters and content
Previously, if a MockMvc request was made with parameters and body
content, the parameters were omitted from the resulting curl, HTTPie
and HTTP request snippets.

This commit updates the affected snippets to ensure that the
parameters are included. The user-provided content is interpreted
as indicating that the parameters should be sent in the query string
rather than as form-encoded content.

Closes gh-239
2016-06-23 17:53:32 +01:00
Andy Wilkinson
37519398c7 Include customized Host header in curl and HTTPie request snippets
Previously, the curl and HTTPie request snippets always excluded the
Host header, relying on the Host header that’s auto-generated by curl
and HTTPie instead. This worked well for the most part, but meant that
incorrect snippets were generated when the request was being sent with
a custom host header that did not match the header that would be
auto-generated.

This commit updates CliOperationRequest to only filter out the Host
header if it’s the same as the header that would be auto-generated
by curl or HTTPie.

Closes gh-258
2016-06-23 15:52:30 +01:00
Andy Wilkinson
a4298b29e7 Include request URI’s port, if any, in default Host header
Previously, OperationRequestFactory would add a Host header if one did
not already exist in the request’s headers, however it did not include
the port. This meant that when the request was being made to a
non-standard port (a port other than 80 for an HTTP request and 443 for
an HTTPS request) the Host header was incorrect.

This commit updates OperationRequestFactory to check the URI for a port
and, if it has one, include it in the Host header.
UriModifyingOperationPreprocessor has also been updated to correctly
include the port in the Host header.

Closes gh-269
2016-06-23 15:45:11 +01:00
Andy Wilkinson
857525954b Update samples following the release of 1.1.0.RELEASE 2016-06-23 15:41:36 +01:00
Andy Wilkinson
41b7fd63f6 Fix RestAssuredRestDocumentationConfigurerTests.nextFilterIsCalled
The test wasn’t actually verifying that the next filter was being
called. This commit corrects that.
2016-06-16 13:14:43 +01:00
Spring Buildmaster
832f4fdbc3 Next development version 2016-05-31 10:53:12 +00:00
Andy Wilkinson
b804ebbe5a Add a description to the REST Assured module 2016-05-31 11:35:43 +01:00
Andy Wilkinson
686914071a Configure Grails sample to run tests using a random server port
See gh-250
2016-05-31 10:20:19 +01:00
Andy Wilkinson
d5a2dff210 Update the samples to use Spring Boot 1.3.5.RELEASE 2016-05-31 10:07:19 +01:00
Andy Wilkinson
4f87f55aaa Fix link to Spring Framework javadoc 2016-05-31 10:04:30 +01:00
Andy Wilkinson
8ca8c85d32 Merge pull request #250 from Jennifer Strater
* gh-250:
  Polish "Add Grails sample app" (1338df9)
  Add Grails sample app
2016-05-31 10:01:30 +01:00
Andy Wilkinson
34ec9d523d Polish "Add Grails sample app" (1338df9)
The sole structural change is to rearrange the build slightly so that,
like the other samples, the version of the Grails sample's REST Docs
dependency is automatically updated.

See gh-250
2016-05-31 10:00:52 +01:00
Jennifer Strater
64803b5fae Add Grails sample app
Closes gh-250
2016-05-31 10:00:40 +01:00
Andy Wilkinson
c1d245f7d4 Add link to restdocs-wiremock to the README
Closes gh-244
2016-05-25 14:18:55 +01:00
Andy Wilkinson
bec03a1f3f Merge branch '1.0.x' 2016-05-25 14:13:51 +01:00
Spring Buildmaster
a9305cba87 Next development version 2016-05-25 12:26:06 +00:00
Andy Wilkinson
26ff2ec8a5 Update HATEOAS sample to use new API for generating extra snippets
See gh-249
2016-05-25 12:02:53 +01:00
Andy Wilkinson
251d93ddc8 Correct ordering of Javadoc tags 2016-05-25 11:34:57 +01:00
Andy Wilkinson
0446c99a10 Polishing
- Correct copyright years
- Add `@since` to javadoc of new public classes
- Make new classes final where appropriate
2016-05-25 11:26:02 +01:00
Andy Wilkinson
42353a0b5f Improve the API for generating additional snippets
Previously, if alwaysDo was used and the user wanted to generate
one or more additional snippets when calling perform a separate call
to `snippets` was made prior to calling `perform`. This had two
problems:

 - it required the result handler to be stateful (see gh-243)
 - it wasn't clear that the additional snippets would be produced when
   a subsequent call to perform was made

This commit introduces a new API that allows the additional snippets
to be specified within the MockMvc call. The old API has been
deprecated and will be removed in 2.0.

Closes gh-249
2016-05-25 11:01:48 +01:00
Andy Wilkinson
cb1f98c601 Improve handling of parameters with null values
Closes gh-199
2016-05-24 16:39:57 +01:00
Andy Wilkinson
6935f603f2 Polish ResourceBundleConstraintDescriptionResolver and related tests
Closes gh-234
2016-05-24 16:27:37 +01:00
Andy Wilkinson
4715351cce Make it easier to provide a placeholder resolver that uses the context
Closes gh-235
2016-05-24 15:42:22 +01:00
Andy Wilkinson
a0f82f283b Merge pull request #247 from Marcel Overdijk
* gh-247:
  Polish "Allow descriptors to be provided as a List as well as via varags"
  Allow descriptors to be provided as a List as well as via varags
2016-05-24 13:59:19 +01:00
Andy Wilkinson
81b2f11ebf Polish "Allow descriptors to be provided as a List as well as via varags"
See gh-247
2016-05-24 13:54:17 +01:00
Marcel Overdijk
5edc27fc99 Allow descriptors to be provided as a List as well as via varags
Closes gh-247
2016-05-24 13:34:30 +01:00
Andy Wilkinson
7e116ae0cd Merge pull request #245 from Marcel Overdijk
* gh-245:
  Provide utility method for applying a path prefix to field descriptors
2016-05-24 13:29:47 +01:00