From 23e8ad3daedee76dd2ad1d922ccc132b9684c92c Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 2 Dec 2014 12:20:08 +0000 Subject: [PATCH] Update the README to reflect the changes to how document is used --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e1018299..5cfd9e24 100644 --- a/README.md +++ b/README.md @@ -91,11 +91,14 @@ public void setUp() { The default values are `http`, `localhost`, and `8080`. You can omit the above configuration if these defaults meet your needs. -To document a MockMvc call, wrap it in a call to `RestDocumentation.document`: +To document a MockMvc call, you use MockMvc's `andDo` method, passing it a +`RestDocumentationResultHandler` that can be easily obtained from +the static `RestDocumentation.document` method: ```java public void getIndex() { - document("index", this.mockMvc.perform(get("/").accept(MediaType.APPLICATION_JSON))); + this.mockMvc.perform(get("/").accept(MediaType.APPLICATION_JSON)) + .andDo(document("index")); } ```