Class ContractDslSnippet

java.lang.Object
org.springframework.restdocs.snippet.TemplatedSnippet
org.springframework.cloud.contract.wiremock.restdocs.ContractDslSnippet
All Implemented Interfaces:
org.springframework.restdocs.snippet.Snippet

public class ContractDslSnippet extends org.springframework.restdocs.snippet.TemplatedSnippet
A Snippet that documents the Spring Cloud Contract Groovy DSL.
Since:
1.0.4
Author:
Marcin Grzejszczak
  • Constructor Details

    • ContractDslSnippet

      protected ContractDslSnippet()
      Creates a new ContractDslSnippet with no additional attributes.
    • ContractDslSnippet

      protected ContractDslSnippet(Map<String,Object> attributes)
      Creates a new ContractDslSnippet with the given additional attributes that will be included in the model during template rendering.
      Parameters:
      attributes - The additional attributes
  • Method Details

    • createModel

      protected Map<String,Object> createModel(org.springframework.restdocs.operation.Operation operation)
      Specified by:
      createModel in class org.springframework.restdocs.snippet.TemplatedSnippet
    • document

      public void document(org.springframework.restdocs.operation.Operation operation) throws IOException
      Specified by:
      document in interface org.springframework.restdocs.snippet.Snippet
      Overrides:
      document in class org.springframework.restdocs.snippet.TemplatedSnippet
      Throws:
      IOException
    • getTemplate

      protected String getTemplate()
    • insertAdditionalModel

      protected void insertAdditionalModel(org.springframework.restdocs.operation.Operation operation, Map<String,Object> modelForContract)