Provide a default output directory for snippets based on build tool
Rather than requiring an output directory to be explcitly configured, a default is now automatically configured based on the build tool that's being used. When using Gradle, snippets will be generated in build/generated-snippets. When using Maven, snippets will be generated in target/generated-snippets. See gh-297
This commit is contained in:
committed by
Andy Wilkinson
parent
c1540838a3
commit
3ac4a1acad
@@ -42,7 +42,7 @@ import com.jayway.restassured.specification.RequestSpecification;
|
||||
public class SampleRestAssuredApplicationTests {
|
||||
|
||||
@Rule
|
||||
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation("build/generated-snippets");
|
||||
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation();
|
||||
|
||||
private RequestSpecification documentationSpec;
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
public class ApiDocumentation {
|
||||
|
||||
@Rule
|
||||
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation("build/generated-snippets");
|
||||
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation();
|
||||
|
||||
@Autowired
|
||||
private NoteRepository noteRepository;
|
||||
|
||||
@@ -61,7 +61,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
public class ApiDocumentation {
|
||||
|
||||
@Rule
|
||||
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation("target/generated-snippets");
|
||||
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation();
|
||||
|
||||
@Autowired
|
||||
private NoteRepository noteRepository;
|
||||
|
||||
@@ -58,7 +58,7 @@ import com.jayway.jsonpath.JsonPath;
|
||||
public class GettingStartedDocumentation {
|
||||
|
||||
@Rule
|
||||
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation("target/generated-snippets");
|
||||
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation();
|
||||
|
||||
@Autowired
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@@ -70,7 +70,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
public class ApiDocumentation {
|
||||
|
||||
@Rule
|
||||
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation("build/generated-snippets");
|
||||
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation();
|
||||
|
||||
private RestDocumentationResultHandler documentationHandler;
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ import com.jayway.jsonpath.JsonPath;
|
||||
public class GettingStartedDocumentation {
|
||||
|
||||
@Rule
|
||||
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation("build/generated-snippets");
|
||||
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation();
|
||||
|
||||
@Autowired
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@@ -39,7 +39,7 @@ import org.testng.annotations.Test;
|
||||
@WebAppConfiguration
|
||||
public class SampleTestNgApplicationTests extends AbstractTestNGSpringContextTests {
|
||||
|
||||
private final ManualRestDocumentation restDocumentation = new ManualRestDocumentation("build/generated-snippets");
|
||||
private final ManualRestDocumentation restDocumentation = new ManualRestDocumentation();
|
||||
|
||||
@Autowired
|
||||
private WebApplicationContext context;
|
||||
|
||||
Reference in New Issue
Block a user