From 4715351cce088d1aa121fea7ae8986361a803e1d Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 20 May 2016 16:12:12 +0200 Subject: [PATCH] Make it easier to provide a placeholder resolver that uses the context Closes gh-235 --- .../config/RestDocumentationConfigurer.java | 4 +- .../snippet/PlaceholderResolverFactory.java | 38 +++++++++++++++++++ ...tionContextPlaceholderResolverFactory.java | 37 ++++++++++++++++++ .../snippet/StandardWriterResolver.java | 37 +++++++++++++----- .../snippet/StandardWriterResolverTests.java | 7 ++-- .../restdocs/test/OperationBuilder.java | 4 +- 6 files changed, 110 insertions(+), 17 deletions(-) create mode 100644 spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/PlaceholderResolverFactory.java create mode 100644 spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/RestDocumentationContextPlaceholderResolverFactory.java diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/config/RestDocumentationConfigurer.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/config/RestDocumentationConfigurer.java index 2b1216f4..c6cb1ffc 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/config/RestDocumentationConfigurer.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/config/RestDocumentationConfigurer.java @@ -23,7 +23,7 @@ import java.util.Map; import org.springframework.restdocs.RestDocumentationContext; import org.springframework.restdocs.mustache.Mustache; -import org.springframework.restdocs.snippet.RestDocumentationContextPlaceholderResolver; +import org.springframework.restdocs.snippet.RestDocumentationContextPlaceholderResolverFactory; import org.springframework.restdocs.snippet.StandardWriterResolver; import org.springframework.restdocs.snippet.WriterResolver; import org.springframework.restdocs.templates.StandardTemplateResourceResolver; @@ -138,7 +138,7 @@ public abstract class RestDocumentationConfigurer