org.springframework.restdocs.templates.TemplateFormat Java Examples

The following examples show how to use org.springframework.restdocs.templates.TemplateFormat. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OperationAttributeHelper.java    From spring-auto-restdocs with Apache License 2.0 5 votes vote down vote up
public static TemplateFormat getTemplateFormat(Operation operation) {
    StandardWriterResolver writerResolver = (StandardWriterResolver) operation.getAttributes()
            .get(WriterResolver.class.getName());
    Field field = findField(StandardWriterResolver.class, "templateFormat");
    makeAccessible(field);
    return (TemplateFormat) getField(field, writerResolver);
}
 
Example #2
Source File: SectionSnippetTest.java    From spring-auto-restdocs with Apache License 2.0 4 votes vote down vote up
public SectionSnippetTest() {
    // Only runs for AsciiDoctor, because Markdown is not supported.
    TemplateFormat templateFormat = TemplateFormats.asciidoctor();
    this.generatedSnippets = new GeneratedSnippets(templateFormat);
    this.operationBuilder = new OperationBuilder(templateFormat);
}
 
Example #3
Source File: JacksonResponseFieldSnippetTest.java    From spring-auto-restdocs with Apache License 2.0 4 votes vote down vote up
public JacksonResponseFieldSnippetTest(String name, TemplateFormat templateFormat) {
    super(name, templateFormat);
}
 
Example #4
Source File: JacksonModelAttributeSnippetTest.java    From spring-auto-restdocs with Apache License 2.0 4 votes vote down vote up
public JacksonModelAttributeSnippetTest(String name, TemplateFormat templateFormat) {
    super(name, templateFormat);
}
 
Example #5
Source File: JacksonRequestFieldSnippetTest.java    From spring-auto-restdocs with Apache License 2.0 4 votes vote down vote up
public JacksonRequestFieldSnippetTest(String name, TemplateFormat templateFormat) {
    super(name, templateFormat);
}
 
Example #6
Source File: AuthorizationSnippetTest.java    From spring-auto-restdocs with Apache License 2.0 4 votes vote down vote up
public AuthorizationSnippetTest(String name, TemplateFormat templateFormat) {
    super(name, templateFormat);
}
 
Example #7
Source File: DescriptionSnippetTest.java    From spring-auto-restdocs with Apache License 2.0 4 votes vote down vote up
public DescriptionSnippetTest(String name, TemplateFormat templateFormat) {
    super(name, templateFormat);
}
 
Example #8
Source File: MethodAndPathSnippetTest.java    From spring-auto-restdocs with Apache License 2.0 4 votes vote down vote up
public MethodAndPathSnippetTest(String name, TemplateFormat templateFormat) {
    super(name, templateFormat);
}
 
Example #9
Source File: EmbeddedSnippetTest.java    From spring-auto-restdocs with Apache License 2.0 4 votes vote down vote up
public EmbeddedSnippetTest(String name, TemplateFormat templateFormat) {
    super(name, templateFormat);
}
 
Example #10
Source File: LinksSnippetTest.java    From spring-auto-restdocs with Apache License 2.0 4 votes vote down vote up
public LinksSnippetTest(String name, TemplateFormat templateFormat) {
    super(name, templateFormat);
}
 
Example #11
Source File: OperationBuilder.java    From restdocs-wiremock with Apache License 2.0 4 votes vote down vote up
public OperationBuilder(String name, File outputDirectory,
		TemplateFormat templateFormat) {
	this.name = name;
	this.outputDirectory = outputDirectory;
	this.templateFormat = templateFormat;
}
 
Example #12
Source File: RequestParametersSnippetTest.java    From spring-auto-restdocs with Apache License 2.0 4 votes vote down vote up
public RequestParametersSnippetTest(String name, TemplateFormat templateFormat) {
    super(name, templateFormat);
}
 
Example #13
Source File: RequestHeaderSnippetTest.java    From spring-auto-restdocs with Apache License 2.0 4 votes vote down vote up
public RequestHeaderSnippetTest(String name, TemplateFormat templateFormat) {
    super(name, templateFormat);
}
 
Example #14
Source File: PathParametersSnippetTest.java    From spring-auto-restdocs with Apache License 2.0 4 votes vote down vote up
public PathParametersSnippetTest(String name, TemplateFormat templateFormat) {
    super(name, templateFormat);
}
 
Example #15
Source File: OperationAttributeHelper.java    From spring-auto-restdocs with Apache License 2.0 4 votes vote down vote up
public static TemplateFormatting determineTemplateFormatting(TemplateFormat templateFormat) {
    return templateFormat.getId().equals(TemplateFormats.asciidoctor().getId())
            ? TemplateFormatting.ASCIIDOC : TemplateFormatting.MARKDOWN;
}
 
Example #16
Source File: ExpectedSnippet.java    From restdocs-wiremock with Apache License 2.0 4 votes vote down vote up
public ExpectedSnippet(TemplateFormat templateFormat) {
	this.templateFormat = templateFormat;
	this.snippet = SnippetMatchers.snippet(templateFormat);
}
 
Example #17
Source File: SnippetMatchers.java    From restdocs-wiremock with Apache License 2.0 4 votes vote down vote up
private SnippetMatcher(TemplateFormat templateFormat) {
	this.templateFormat = templateFormat;
}
 
Example #18
Source File: SnippetMatchers.java    From restdocs-wiremock with Apache License 2.0 4 votes vote down vote up
public static SnippetMatcher snippet(TemplateFormat templateFormat) {
	return new SnippetMatcher(templateFormat);
}