Fix the Slate sample

Closes gh-4
This commit is contained in:
Andy Wilkinson
2024-05-31 13:15:03 +01:00
parent 4e93902bc8
commit e8661ae55c
2 changed files with 3 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ dependencies {
} }
test { test {
useJUnitPlatform()
outputs.dir snippetsDir outputs.dir snippetsDir
} }

View File

@@ -46,6 +46,7 @@ import org.springframework.hateoas.MediaTypes;
import org.springframework.restdocs.RestDocumentationContextProvider; import org.springframework.restdocs.RestDocumentationContextProvider;
import org.springframework.restdocs.RestDocumentationExtension; import org.springframework.restdocs.RestDocumentationExtension;
import org.springframework.restdocs.payload.JsonFieldType; import org.springframework.restdocs.payload.JsonFieldType;
import org.springframework.restdocs.templates.TemplateFormats;
import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.WebApplicationContext;
@@ -75,7 +76,7 @@ class ApiDocumentation {
@BeforeEach @BeforeEach
public void setUp(RestDocumentationContextProvider restDocumentation) { public void setUp(RestDocumentationContextProvider restDocumentation) {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context) this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context)
.apply(documentationConfiguration(restDocumentation)).build(); .apply(documentationConfiguration(restDocumentation).snippets().withTemplateFormat(TemplateFormats.markdown())).build();
} }
@Test @Test