org.springframework.restdocs.templates.default-dsl-contract-only.snippet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-cloud-contract-wiremock Show documentation
Show all versions of spring-cloud-contract-wiremock Show documentation
Spring Cloud Contract Wiremock
import org.springframework.cloud.contract.spec.Contract
Contract.make {
request {
method '{{request_method}}'
urlPath('{{request_url}}') {{#request_urlpath_present}} {
queryParameters {
{{#request_queryparams}}
parameter('''{{key}}''', '''{{value}}''')
{{/request_queryparams}}
}
} {{/request_urlpath_present}}
{{#request_body_present}}
body('''{{request_body}}''')
{{/request_body_present}}
{{#request_headers_present}}
headers {
{{#request_headers}}
header('''{{key}}''', '''{{value}}''')
{{/request_headers}}
}
{{/request_headers_present}}
{{#request_json_paths_present}}
bodyMatchers {
{{#request_json_paths}}
jsonPath('''{{jsonPath}}''', byEquality())
{{/request_json_paths}}
}
{{/request_json_paths_present}}
}
response {
status {{response_status}}
{{#response_body_present}}
body('''{{response_body}}''')
{{/response_body_present}}
{{#response_headers_present}}
headers {
{{#response_headers}}
header('''{{key}}''', '''{{value}}''')
{{/response_headers}}
}
{{/response_headers_present}}
}
{{#priority_present}}
priority {{priority}}
{{/priority_present}}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy