Break the package cycle caused by the introduction of SnippetFormat
This commit is contained in:
@@ -59,11 +59,11 @@ include::{examples-dir}/com/example/restassured/CustomEncoding.java[tags=custom-
|
||||
|
||||
|
||||
|
||||
[[configuration-snippet-format]]
|
||||
=== Snippet format
|
||||
[[configuration-snippet-template-format]]
|
||||
=== Snippet template format
|
||||
|
||||
The default snippet format is Asciidoctor. Markdown is also supported out of the box. You
|
||||
can change the default format using the `RestDocumentationConfigurer` API:
|
||||
The default snippet template format is Asciidoctor. Markdown is also supported out of the
|
||||
box. You can change the default format using the `RestDocumentationConfigurer` API:
|
||||
|
||||
[source,java,indent=0,role="primary"]
|
||||
.MockMvc
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.restdocs.RestDocumentation;
|
||||
import org.springframework.restdocs.snippet.SnippetFormats;
|
||||
import org.springframework.restdocs.templates.TemplateFormats;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
@@ -42,7 +42,7 @@ public class CustomFormat {
|
||||
// tag::custom-format[]
|
||||
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context)
|
||||
.apply(documentationConfiguration(this.restDocumentation)
|
||||
.snippets().withFormat(SnippetFormats.markdown()))
|
||||
.snippets().withTemplateFormat(TemplateFormats.markdown()))
|
||||
.build();
|
||||
// end::custom-format[]
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ package com.example.restassured;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.springframework.restdocs.RestDocumentation;
|
||||
import org.springframework.restdocs.snippet.SnippetFormats;
|
||||
import org.springframework.restdocs.templates.TemplateFormats;
|
||||
|
||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||
import com.jayway.restassured.specification.RequestSpecification;
|
||||
@@ -38,7 +38,7 @@ public class CustomFormat {
|
||||
// tag::custom-format[]
|
||||
this.spec = new RequestSpecBuilder()
|
||||
.addFilter(documentationConfiguration(this.restDocumentation)
|
||||
.snippets().withFormat(SnippetFormats.markdown()))
|
||||
.snippets().withTemplateFormat(TemplateFormats.markdown()))
|
||||
.build();
|
||||
// end::custom-format[]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user