Example usage for org.springframework.restdocs.templates TemplateFormat getFileExtension

List of usage examples for org.springframework.restdocs.templates TemplateFormat getFileExtension

Introduction

In this page you can find the example usage for org.springframework.restdocs.templates TemplateFormat getFileExtension.

Prototype

String getFileExtension();

Source Link

Document

Returns the file extension to use for files generated from templates in this format.

Usage

From source file:io.github.restdocsext.jersey.test.SnippetMatchers.java

@SuppressWarnings({ "rawtypes" })
public static CodeBlockMatcher<?> codeBlock(TemplateFormat format, String language) {
    if ("adoc".equals(format.getFileExtension())) {
        return new AsciidoctorCodeBlockMatcher(language, null);
    }/*from  w  ww  . j  av  a2s  . c o  m*/
    return new MarkdownCodeBlockMatcher(language);
}

From source file:io.github.restdocsext.jersey.test.SnippetMatchers.java

public static TableMatcher<?> tableWithHeader(TemplateFormat format, String... headers) {
    if ("adoc".equals(format.getFileExtension())) {
        return new AsciidoctorTableMatcher(null, headers);
    }//from  w w  w. ja  v  a  2 s .  c  o m
    return new MarkdownTableMatcher(null, headers);
}

From source file:io.github.restdocsext.jersey.test.SnippetMatchers.java

public static HttpResponseMatcher httpResponse(TemplateFormat format, HttpStatus status) {
    if ("adoc".equals(format.getFileExtension())) {
        return new HttpResponseMatcher(status, new AsciidoctorCodeBlockMatcher<>("http", "nowrap"), 3);
    }//from   w w  w.j  a v a2s .  co m
    return new HttpResponseMatcher(status, new MarkdownCodeBlockMatcher<>("http"), 2);
}

From source file:io.github.restdocsext.jersey.test.SnippetMatchers.java

public static TableMatcher<?> tableWithTitleAndHeader(TemplateFormat format, String title, String... headers) {
    if ("adoc".equals(format.getFileExtension())) {
        return new AsciidoctorTableMatcher(title, headers);
    }/*from w  w w  .j a  v a 2 s  . c om*/
    return new MarkdownTableMatcher(title, headers);
}

From source file:io.github.restdocsext.jersey.test.SnippetMatchers.java

public static HttpRequestMatcher httpRequest(TemplateFormat format, RequestMethod requestMethod, String uri) {
    if ("adoc".equals(format.getFileExtension())) {
        return new HttpRequestMatcher(requestMethod, uri, new AsciidoctorCodeBlockMatcher<>("http", "nowrap"),
                3);//from  w ww .j a v  a 2s. c  o  m
    }
    return new HttpRequestMatcher(requestMethod, uri, new MarkdownCodeBlockMatcher<>("http"), 2);
}