Merge branch '2.1.x'
# Conflicts: # README.adoc
This commit is contained in:
4
.github/CONTRIBUTING.md
vendored
4
.github/CONTRIBUTING.md
vendored
@@ -28,7 +28,7 @@ added after the original pull request but before a merge.
|
||||
you can import formatter settings using the
|
||||
`eclipse-code-formatter.xml` file from the
|
||||
[Spring Cloud Build](https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml) project. If using IntelliJ, you can use the
|
||||
[Eclipse Code Formatter Plugin](http://plugins.jetbrains.com/plugin/6546) to import the same file.
|
||||
[Eclipse Code Formatter Plugin](https://plugins.jetbrains.com/plugin/6546) to import the same file.
|
||||
* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
|
||||
`@author` tag identifying you, and preferably at least a paragraph on what the class is
|
||||
for.
|
||||
@@ -40,6 +40,6 @@ added after the original pull request but before a merge.
|
||||
* A few unit tests would help a lot as well -- someone has to do it.
|
||||
* If no-one else is using your branch, please rebase it against the current master (or
|
||||
other target branch in the main project).
|
||||
* When writing a commit message please follow [these conventions](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
|
||||
* When writing a commit message please follow [these conventions](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
|
||||
if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
|
||||
message (where XXXX is the issue number).
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -23,7 +23,7 @@ bin/
|
||||
*.ear
|
||||
*.versionsBackup
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
# virtual machine crash logs, see https://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
*.class
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
https://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Asciidoctor default stylesheet | MIT License | http://asciidoctor.org */
|
||||
/* Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */
|
||||
/* Remove the comments around the @import statement below when using this as a custom stylesheet */
|
||||
/*@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic|Noto+Serif:400,400italic,700,700italic|Droid+Sans+Mono:400";*/
|
||||
article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary {
|
||||
|
||||
@@ -17,7 +17,7 @@ producers and consumers -- for both HTTP and message-based interactions.
|
||||
|
||||
If you prefer to learn about the project by doing some tutorials, you can check out the
|
||||
workshops under
|
||||
http://cloud-samples.spring.io/spring-cloud-contract-samples/workshops.html[this link].
|
||||
https://cloud-samples.spring.io/spring-cloud-contract-samples/workshops.html[this link].
|
||||
|
||||
=== Spring Cloud Contract Verifier
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ structure presented in the previous snippet.
|
||||
<assembly
|
||||
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 https://maven.apache.org/xsd/assembly-1.1.3.xsd">
|
||||
<id>stubs</id>
|
||||
<formats>
|
||||
<format>jar</format>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
== Spring Cloud Contract WireMock
|
||||
|
||||
The Spring Cloud Contract WireMock modules let you use http://wiremock.org[WireMock] in a
|
||||
The Spring Cloud Contract WireMock modules let you use https://github.com/tomakehurst/wiremock[WireMock] in a
|
||||
Spring Boot application. Check out the
|
||||
https://github.com/spring-cloud/spring-cloud-contract/tree/{branch}/samples[samples]
|
||||
for more details.
|
||||
@@ -160,11 +160,11 @@ include::{doc_samples}/src/test/java/com/example/WiremockForDocsMockServerApplic
|
||||
The `baseUrl` value is prepended to all mock calls, and the `stubs()` method takes a stub
|
||||
path resource pattern as an argument. In the preceding example, the stub defined at
|
||||
`/stubs/resource.json` is loaded into the mock server. If the `RestTemplate` is asked to
|
||||
visit `http://example.org/`, it gets the responses as being declared at that URL. More
|
||||
visit `https://example.org/`, it gets the responses as being declared at that URL. More
|
||||
than one stub pattern can be specified, and each one can be a directory (for a recursive
|
||||
list of all ".json"), a fixed filename (as in the example above), or an Ant-style
|
||||
pattern. The JSON format is the normal WireMock format, which you can read about in the
|
||||
http://wiremock.org/docs/stubbing/[WireMock website].
|
||||
https://wiremock.org/docs/stubbing/[WireMock website].
|
||||
|
||||
Currently, the Spring Cloud Contract Verifier supports Tomcat, Jetty, and Undertow as
|
||||
Spring Boot embedded servers, and Wiremock itself has "native" support for a particular
|
||||
|
||||
@@ -640,7 +640,7 @@ given name.
|
||||
matches the JSON Path.
|
||||
|
||||
If you're using the YAML contract definition you have to use the
|
||||
http://handlebarsjs.com/[Handlebars] `{{{ }}}` notation with custom, Spring Cloud Contract
|
||||
https://handlebarsjs.com/[Handlebars] `{{{ }}}` notation with custom, Spring Cloud Contract
|
||||
functions to achieve this.
|
||||
|
||||
* `{{{ request.url }}}`: Returns the request URL and query parameters.
|
||||
|
||||
@@ -164,7 +164,7 @@ org.springframework.cloud.contract.spec.Contract.make {
|
||||
}
|
||||
----
|
||||
|
||||
IMPORTANT: Please read the http://groovy-lang.org/json.html[Groovy docs related to JSON] to understand how to
|
||||
IMPORTANT: Please read the https://groovy-lang.org/json.html[Groovy docs related to JSON] to understand how to
|
||||
properly structure the request / response bodies.
|
||||
|
||||
=== How to do Stubs versioning?
|
||||
@@ -316,7 +316,7 @@ When the *consumer* wants to work on the contracts offline, instead of cloning t
|
||||
consumer team clones the common repository, goes to the required producer's folder (e.g. `com/example/server`)
|
||||
and runs `mvn clean install -DskipTests` to install locally the stubs converted from the contracts.
|
||||
|
||||
TIP: You need to have http://maven.apache.org/download.cgi[Maven installed locally]
|
||||
TIP: You need to have https://maven.apache.org/download.cgi[Maven installed locally]
|
||||
|
||||
==== Producer
|
||||
|
||||
@@ -690,7 +690,7 @@ to find stub definitions and contracts. E.g. for `com.example:foo:1.0.0` the pat
|
||||
|
||||
=== Can I use the Pact Broker?
|
||||
|
||||
When using http://pact.io/[Pact] you can use the https://github.com/pact-foundation/pact_broker[Pact Broker]
|
||||
When using https://pact.io/[Pact] you can use the https://github.com/pact-foundation/pact_broker[Pact Broker]
|
||||
to store and share Pact definitions. Starting from Spring Cloud Contract
|
||||
2.0.0 one can fetch Pact files from the Pact Broker to generate
|
||||
tests and stubs.
|
||||
|
||||
@@ -20,7 +20,7 @@ Spring Cloud Contract Verifier.
|
||||
|
||||
Before becoming Spring Cloud Contract, this project was called https://github.com/Codearte/accurest[Accurest].
|
||||
It was created by https://twitter.com/mgrzejszczak[Marcin Grzejszczak] and https://twitter.com/jkubrynski[Jakub Kubrynski]
|
||||
from (http://codearte.io[codearte.io].
|
||||
from (https://github.com/Codearte[Codearte].
|
||||
|
||||
The `0.1.0` release took place on 26 Jan 2015 and it became stable with `1.0.0` release on 29 Feb 2016.
|
||||
|
||||
@@ -732,7 +732,7 @@ a map notation or String with interpolations.
|
||||
Consult the <<contract-dsl>> section for more information. We highly recommend using the map notation!
|
||||
|
||||
TIP: You must understand the map notation in order to set up contracts. Please read the
|
||||
http://groovy-lang.org/json.html[Groovy docs regarding JSON].
|
||||
https://groovy-lang.org/json.html[Groovy docs regarding JSON].
|
||||
|
||||
The previously shown contract is an agreement between two sides that:
|
||||
|
||||
@@ -911,7 +911,7 @@ the `contracts` folder, pick only one, which should be `fraud`. Add the `Base` s
|
||||
capitalize `fraud`. That gives you the `FraudBase` test class name.
|
||||
|
||||
All the generated tests extend that class. Over there, you can set up your Spring Context
|
||||
or whatever is necessary. In this case, use http://rest-assured.io/[Rest Assured MVC] to
|
||||
or whatever is necessary. In this case, use https://github.com/rest-assured/rest-assured[Rest Assured MVC] to
|
||||
start the server side `FraudDetectionController`.
|
||||
|
||||
[source,java,indent=0]
|
||||
@@ -1045,10 +1045,10 @@ video::sAAklvxmPmk[youtube,start=538,width=640,height=480]
|
||||
|
||||
==== Readings
|
||||
|
||||
- http://www.slideshare.net/MarcinGrzejszczak/stick-to-the-rules-consumer-driven-contracts-201507-confitura[Slides from Marcin Grzejszczak's talk about Accurest]
|
||||
- http://toomuchcoding.com/blog/categories/accurest/[Accurest related articles from Marcin Grzejszczak's blog]
|
||||
- http://toomuchcoding.com/blog/categories/spring-cloud-contract/[Spring Cloud Contract related articles from Marcin Grzejszczak's blog]
|
||||
- http://groovy-lang.org/json.html[Groovy docs regarding JSON]
|
||||
- https://www.slideshare.net/MarcinGrzejszczak/stick-to-the-rules-consumer-driven-contracts-201507-confitura[Slides from Marcin Grzejszczak's talk about Accurest]
|
||||
- https://toomuchcoding.com/blog/categories/accurest/[Accurest related articles from Marcin Grzejszczak's blog]
|
||||
- https://toomuchcoding.com/blog/categories/spring-cloud-contract/[Spring Cloud Contract related articles from Marcin Grzejszczak's blog]
|
||||
- https://groovy-lang.org/json.html[Groovy docs regarding JSON]
|
||||
|
||||
=== Samples
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ In order to use Spring Cloud Contract Verifier with WireMock, you muse use eithe
|
||||
Gradle or a Maven plugin.
|
||||
|
||||
WARNING: If you want to use Spock in your projects, you must add separately the
|
||||
`spock-core` and `spock-spring` modules. Check http://spockframework.github.io/[Spock
|
||||
`spock-core` and `spock-spring` modules. Check https://spockframework.github.io/[Spock
|
||||
docs for more information]
|
||||
|
||||
[[gradle-add-gradle-plugin]]
|
||||
@@ -1007,7 +1007,7 @@ name of `scenario1` and the three following steps:
|
||||
. logout marked as `Step2` which will close the scenario.
|
||||
|
||||
More details about WireMock scenarios can be found at
|
||||
http://wiremock.org/docs/stateful-behaviour/[http://wiremock.org/docs/stateful-behaviour/]
|
||||
https://wiremock.org/docs/stateful-behaviour/[https://wiremock.org/docs/stateful-behaviour/]
|
||||
|
||||
Spring Cloud Contract Verifier also generates tests with a guaranteed order of execution.
|
||||
|
||||
@@ -1059,7 +1059,7 @@ like them to be available for others to download / reference or reuse. In case
|
||||
of the JVM world those artifacts would be JARs, for Ruby these are gems
|
||||
and for Docker those would be Docker images. You can store those artifacts
|
||||
in a manager. Examples of such managers can be https://jfrog.com/artifactory/[Artifactory]
|
||||
or http://www.sonatype.org/nexus/[Nexus].
|
||||
or https://www.sonatype.org/nexus/[Nexus].
|
||||
|
||||
==== How it works
|
||||
|
||||
@@ -1073,7 +1073,7 @@ It's enough for you to mount your contracts, pass the environment variables
|
||||
|
||||
- generate the contract tests
|
||||
- execute the tests against the provided URL
|
||||
- generate the http://wiremock.org[WireMock] stubs
|
||||
- generate the https://github.com/tomakehurst/wiremock[WireMock] stubs
|
||||
- (optional - turned on by default) publish the stubs to a Artifact Manager
|
||||
|
||||
===== Environment Variables
|
||||
|
||||
2
ideas.md
2
ideas.md
@@ -13,5 +13,5 @@ Feature ideas:
|
||||
- [x] `DiscoveryClient` support so backends can be stubbed or mocked transparently (declaratively)
|
||||
- [ ] Actuator endpoints that verify the state of contracts supported by the host service
|
||||
- [x] Something to make PACT easier to use in Spring Boot apps?
|
||||
- [ ] Support [Citrus](http://www.citrusframework.org/) users (somehow?)
|
||||
- [ ] Support [Citrus](https://citrusframework.org/) users (somehow?)
|
||||
- [x] Schema registries for binary formats like protobuf, thrift, avro - Stream does it
|
||||
|
||||
@@ -61,7 +61,7 @@ class Service {
|
||||
|
||||
private final RestTemplate restTemplate;
|
||||
|
||||
@Value("${app.baseUrl:http://example.org}")
|
||||
@Value("${app.baseUrl:https://example.org}")
|
||||
private String base;
|
||||
|
||||
Service(RestTemplate restTemplate) {
|
||||
|
||||
@@ -44,7 +44,7 @@ public class WiremockForDocsMockServerApplicationTests {
|
||||
public void contextLoads() throws Exception {
|
||||
// will read stubs classpath
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate)
|
||||
.baseUrl("http://example.org").stubs("classpath:/stubs/resource.json")
|
||||
.baseUrl("https://example.org").stubs("classpath:/stubs/resource.json")
|
||||
.build();
|
||||
// We're asserting if WireMock responded properly
|
||||
assertThat(this.service.go()).isEqualTo("Hello World");
|
||||
|
||||
@@ -42,7 +42,7 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void contextLoads() throws Exception {
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/stubs/resource.json").build();
|
||||
assertThat(this.service.go()).isEqualTo("Hello World");
|
||||
server.verify();
|
||||
|
||||
@@ -60,7 +60,7 @@ class Service {
|
||||
|
||||
private final RestTemplate restTemplate;
|
||||
|
||||
@Value("${app.baseUrl:http://example.org}")
|
||||
@Value("${app.baseUrl:https://example.org}")
|
||||
private String base;
|
||||
|
||||
Service(RestTemplate restTemplate) {
|
||||
|
||||
@@ -61,7 +61,7 @@ class Service {
|
||||
|
||||
private final RestTemplate restTemplate;
|
||||
|
||||
@Value("${app.baseUrl:http://example.org}")
|
||||
@Value("${app.baseUrl:https://example.org}")
|
||||
private String base;
|
||||
|
||||
Service(RestTemplate restTemplate) {
|
||||
|
||||
@@ -42,7 +42,7 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void contextLoads() throws Exception {
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/stubs/**/*.json").build();
|
||||
assertThat(this.service.go()).isEqualTo("Hello World");
|
||||
server.verify();
|
||||
|
||||
@@ -60,7 +60,7 @@ class Service {
|
||||
|
||||
private final RestTemplate restTemplate;
|
||||
|
||||
@Value("${app.baseUrl:http://example.org}")
|
||||
@Value("${app.baseUrl:https://example.org}")
|
||||
private String base;
|
||||
|
||||
Service(RestTemplate restTemplate) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#WireMock password - http://wiremock.org/docs/running-standalone/
|
||||
#WireMock password - https://wiremock.org/docs/running-standalone/
|
||||
server.ssl.key-store-password=password
|
||||
server.ssl.key-password=password
|
||||
server.ssl.trust-store-password=password
|
||||
|
||||
@@ -60,7 +60,7 @@ class Service {
|
||||
|
||||
private final RestTemplate restTemplate;
|
||||
|
||||
@Value("${app.baseUrl:http://example.org}")
|
||||
@Value("${app.baseUrl:https://example.org}")
|
||||
private String base;
|
||||
|
||||
Service(RestTemplate restTemplate) {
|
||||
|
||||
@@ -42,7 +42,7 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void contextLoads() throws Exception {
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/stubs").build();
|
||||
assertThat(this.service.go()).isEqualTo("Hello World");
|
||||
server.verify();
|
||||
|
||||
@@ -67,7 +67,7 @@ class Controller {
|
||||
@Component
|
||||
class Service {
|
||||
|
||||
@Value("${app.baseUrl:http://example.org}")
|
||||
@Value("${app.baseUrl:https://example.org}")
|
||||
String base;
|
||||
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@@ -33,119 +33,119 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Accept} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-5.3.2" > Section 5.3.2 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.3.2" > Section 5.3.2 of RFC 7231</a>
|
||||
*/
|
||||
String accept() {
|
||||
return "Accept"
|
||||
}
|
||||
/**
|
||||
* The HTTP {@code Accept-Charset} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-5.3.3" > Section 5.3.3 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.3.3" > Section 5.3.3 of RFC 7231</a>
|
||||
*/
|
||||
String acceptCharset() {
|
||||
return "Accept-Charset"
|
||||
}
|
||||
/**
|
||||
* The HTTP {@code Accept-Encoding} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-5.3.4" > Section 5.3.4 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.3.4" > Section 5.3.4 of RFC 7231</a>
|
||||
*/
|
||||
String acceptEncoding() {
|
||||
return "Accept-Encoding"
|
||||
}
|
||||
/**
|
||||
* The HTTP {@code Accept-Language} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-5.3.5" > Section 5.3.5 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.3.5" > Section 5.3.5 of RFC 7231</a>
|
||||
*/
|
||||
String acceptLanguage() {
|
||||
return "Accept-Language"
|
||||
}
|
||||
/**
|
||||
* The HTTP {@code Accept-Ranges} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7233#section-2.3" > Section 5.3.5 of RFC 7233</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7233#section-2.3" > Section 5.3.5 of RFC 7233</a>
|
||||
*/
|
||||
String acceptRanges() {
|
||||
return "Accept-Ranges"
|
||||
}
|
||||
/**
|
||||
* The CORS {@code Access-Control-Allow-Credentials} response header field name.
|
||||
* @see <ahref="http://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
* @see <ahref="https://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
*/
|
||||
String accessControlAllowCredentials() {
|
||||
return "Access-Control-Allow-Credentials"
|
||||
}
|
||||
/**
|
||||
* The CORS {@code Access-Control-Allow-Headers} response header field name.
|
||||
* @see <ahref="http://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
* @see <ahref="https://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
*/
|
||||
String accessControlAllowHeaders() {
|
||||
return "Access-Control-Allow-Headers"
|
||||
}
|
||||
/**
|
||||
* The CORS {@code Access-Control-Allow-Methods} response header field name.
|
||||
* @see <ahref="http://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
* @see <ahref="https://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
*/
|
||||
String accessControlAllowMethods() {
|
||||
return "Access-Control-Allow-Methods"
|
||||
}
|
||||
/**
|
||||
* The CORS {@code Access-Control-Allow-Origin} response header field name.
|
||||
* @see <ahref="http://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
* @see <ahref="https://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
*/
|
||||
String accessControlAllowOrigin() {
|
||||
return "Access-Control-Allow-Origin"
|
||||
}
|
||||
/**
|
||||
* The CORS {@code Access-Control-Expose-Headers} response header field name.
|
||||
* @see <ahref="http://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
* @see <ahref="https://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
*/
|
||||
String accessControlExposeHeaders() {
|
||||
return "Access-Control-Expose-Headers"
|
||||
}
|
||||
/**
|
||||
* The CORS {@code Access-Control-Max-Age} response header field name.
|
||||
* @see <ahref="http://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
* @see <ahref="https://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
*/
|
||||
String accessControlMaxAge() {
|
||||
return "Access-Control-Max-Age"
|
||||
}
|
||||
/**
|
||||
* The CORS {@code Access-Control-Request-Headers} request header field name.
|
||||
* @see <ahref="http://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
* @see <ahref="https://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
*/
|
||||
String accessControlRequestHeaders() {
|
||||
return "Access-Control-Request-Headers"
|
||||
}
|
||||
/**
|
||||
* The CORS {@code Access-Control-Request-Method} request header field name.
|
||||
* @see <ahref="http://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
* @see <ahref="https://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
*/
|
||||
String accessControlRequestMethod() {
|
||||
return "Access-Control-Request-Method"
|
||||
}
|
||||
/**
|
||||
* The HTTP {@code Age} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7234#section-5.1" > Section 5.1 of RFC 7234</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7234#section-5.1" > Section 5.1 of RFC 7234</a>
|
||||
*/
|
||||
String age() {
|
||||
return "Age"
|
||||
}
|
||||
/**
|
||||
* The HTTP {@code Allow} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-7.4.1" > Section 7.4.1 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-7.4.1" > Section 7.4.1 of RFC 7231</a>
|
||||
*/
|
||||
String allow() {
|
||||
return "Allow"
|
||||
}
|
||||
/**
|
||||
* The HTTP {@code Authorization} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7235#section-4.2" > Section 4.2 of RFC 7235</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7235#section-4.2" > Section 4.2 of RFC 7235</a>
|
||||
*/
|
||||
String authorization() {
|
||||
return "Authorization"
|
||||
}
|
||||
/**
|
||||
* The HTTP {@code Cache-Control} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7234#section-5.2" > Section 5.2 of RFC 7234</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7234#section-5.2" > Section 5.2 of RFC 7234</a>
|
||||
*/
|
||||
String cacheControl() {
|
||||
return "Cache-Control"
|
||||
@@ -153,7 +153,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Connection} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7230#section-6.1" > Section 6.1 of RFC 7230</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7230#section-6.1" > Section 6.1 of RFC 7230</a>
|
||||
*/
|
||||
String connection() {
|
||||
return "Connection"
|
||||
@@ -161,7 +161,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Content-Encoding} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-3.1.2.2" > Section 3.1.2.2 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-3.1.2.2" > Section 3.1.2.2 of RFC 7231</a>
|
||||
*/
|
||||
String contentEncoding() {
|
||||
return "Content-Encoding"
|
||||
@@ -169,7 +169,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Content-Disposition} header field name
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc6266" > RFC 6266</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc6266" > RFC 6266</a>
|
||||
*/
|
||||
String contentDisposition() {
|
||||
return "Content-Disposition"
|
||||
@@ -177,7 +177,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Content-Language} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-3.1.3.2" > Section 3.1.3.2 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-3.1.3.2" > Section 3.1.3.2 of RFC 7231</a>
|
||||
*/
|
||||
String contentLanguage() {
|
||||
return "Content-Language"
|
||||
@@ -185,7 +185,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Content-Length} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7230#section-3.3.2" > Section 3.3.2 of RFC 7230</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7230#section-3.3.2" > Section 3.3.2 of RFC 7230</a>
|
||||
*/
|
||||
String contentLength() {
|
||||
return "Content-Length"
|
||||
@@ -193,7 +193,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Content-Location} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-3.1.4.2" > Section 3.1.4.2 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-3.1.4.2" > Section 3.1.4.2 of RFC 7231</a>
|
||||
*/
|
||||
String contentLocation() {
|
||||
return "Content-Location"
|
||||
@@ -201,7 +201,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Content-Range} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7233#section-4.2" > Section 4.2 of RFC 7233</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7233#section-4.2" > Section 4.2 of RFC 7233</a>
|
||||
*/
|
||||
String contentRange() {
|
||||
return "Content-Range"
|
||||
@@ -209,7 +209,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Content-Type} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-3.1.1.5" > Section 3.1.1.5 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" > Section 3.1.1.5 of RFC 7231</a>
|
||||
*/
|
||||
String contentType() {
|
||||
return "Content-Type"
|
||||
@@ -217,7 +217,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Cookie} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc2109#section-4.3.4" > Section 4.3.4 of RFC 2109</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2109#section-4.3.4" > Section 4.3.4 of RFC 2109</a>
|
||||
*/
|
||||
String cookie() {
|
||||
return "Cookie"
|
||||
@@ -225,7 +225,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Date} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-7.1.1.2" > Section 7.1.1.2 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" > Section 7.1.1.2 of RFC 7231</a>
|
||||
*/
|
||||
String date() {
|
||||
return "Date"
|
||||
@@ -233,7 +233,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code ETag} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7232#section-2.3" > Section 2.3 of RFC 7232</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7232#section-2.3" > Section 2.3 of RFC 7232</a>
|
||||
*/
|
||||
String etag() {
|
||||
return "ETag"
|
||||
@@ -241,7 +241,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Expect} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-5.1.1" > Section 5.1.1 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.1.1" > Section 5.1.1 of RFC 7231</a>
|
||||
*/
|
||||
String expect() {
|
||||
return "Expect"
|
||||
@@ -249,7 +249,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Expires} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7234#section-5.3" > Section 5.3 of RFC 7234</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7234#section-5.3" > Section 5.3 of RFC 7234</a>
|
||||
*/
|
||||
String expires() {
|
||||
return "Expires"
|
||||
@@ -257,7 +257,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code From} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-5.5.1" > Section 5.5.1 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.5.1" > Section 5.5.1 of RFC 7231</a>
|
||||
*/
|
||||
String from() {
|
||||
return "From"
|
||||
@@ -265,7 +265,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Host} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7230#section-5.4" > Section 5.4 of RFC 7230</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7230#section-5.4" > Section 5.4 of RFC 7230</a>
|
||||
*/
|
||||
String host() {
|
||||
return "Host"
|
||||
@@ -273,7 +273,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code If-Match} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7232#section-3.1" > Section 3.1 of RFC 7232</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7232#section-3.1" > Section 3.1 of RFC 7232</a>
|
||||
*/
|
||||
String ifMatch() {
|
||||
return "If-Match"
|
||||
@@ -281,7 +281,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code If-Modified-Since} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7232#section-3.3" > Section 3.3 of RFC 7232</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7232#section-3.3" > Section 3.3 of RFC 7232</a>
|
||||
*/
|
||||
String ifModifiedSince() {
|
||||
return "If-Modified-Since"
|
||||
@@ -289,7 +289,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code If-None-Match} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7232#section-3.2" > Section 3.2 of RFC 7232</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7232#section-3.2" > Section 3.2 of RFC 7232</a>
|
||||
*/
|
||||
String ifNoneMatch() {
|
||||
return "If-None-Match"
|
||||
@@ -297,7 +297,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code If-Range} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7233#section-3.2" > Section 3.2 of RFC 7233</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7233#section-3.2" > Section 3.2 of RFC 7233</a>
|
||||
*/
|
||||
String ifRange() {
|
||||
return "If-Range"
|
||||
@@ -305,7 +305,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code If-Unmodified-Since} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7232#section-3.4" > Section 3.4 of RFC 7232</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7232#section-3.4" > Section 3.4 of RFC 7232</a>
|
||||
*/
|
||||
String ifUnmodifiedSince() {
|
||||
return "If-Unmodified-Since"
|
||||
@@ -313,7 +313,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Last-Modified} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7232#section-2.2" > Section 2.2 of RFC 7232</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7232#section-2.2" > Section 2.2 of RFC 7232</a>
|
||||
*/
|
||||
String lastModified() {
|
||||
return "Last-Modified"
|
||||
@@ -321,7 +321,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Link} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc5988" > RFC 5988</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc5988" > RFC 5988</a>
|
||||
*/
|
||||
String link() {
|
||||
return "Link"
|
||||
@@ -329,7 +329,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Location} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-7.1.2" > Section 7.1.2 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-7.1.2" > Section 7.1.2 of RFC 7231</a>
|
||||
*/
|
||||
String location() {
|
||||
return "Location"
|
||||
@@ -337,14 +337,14 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Max-Forwards} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-5.1.2" > Section 5.1.2 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.1.2" > Section 5.1.2 of RFC 7231</a>
|
||||
*/
|
||||
String max_forwards() {
|
||||
return "Max-Forwards"
|
||||
}
|
||||
/**
|
||||
* The HTTP {@code Origin} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc6454" > RFC 6454</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc6454" > RFC 6454</a>
|
||||
*/
|
||||
String origin() {
|
||||
return "Origin"
|
||||
@@ -352,7 +352,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Pragma} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7234#section-5.4" > Section 5.4 of RFC 7234</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7234#section-5.4" > Section 5.4 of RFC 7234</a>
|
||||
*/
|
||||
String pragma() {
|
||||
return "Pragma"
|
||||
@@ -360,7 +360,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Proxy-Authenticate} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7235#section-4.3" > Section 4.3 of RFC 7235</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7235#section-4.3" > Section 4.3 of RFC 7235</a>
|
||||
*/
|
||||
String proxyAuthenticate() {
|
||||
return "Proxy-Authenticate"
|
||||
@@ -368,7 +368,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Proxy-Authorization} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7235#section-4.4" > Section 4.4 of RFC 7235</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7235#section-4.4" > Section 4.4 of RFC 7235</a>
|
||||
*/
|
||||
String proxyAuthorization() {
|
||||
return "Proxy-Authorization"
|
||||
@@ -376,7 +376,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Range} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7233#section-3.1" > Section 3.1 of RFC 7233</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7233#section-3.1" > Section 3.1 of RFC 7233</a>
|
||||
*/
|
||||
String range() {
|
||||
return "Range"
|
||||
@@ -384,7 +384,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Referer} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-5.5.2" > Section 5.5.2 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.5.2" > Section 5.5.2 of RFC 7231</a>
|
||||
*/
|
||||
String referer() {
|
||||
return "Referer"
|
||||
@@ -392,7 +392,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Retry-After} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-7.1.3" > Section 7.1.3 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-7.1.3" > Section 7.1.3 of RFC 7231</a>
|
||||
*/
|
||||
String retryAfter() {
|
||||
return "Retry-After"
|
||||
@@ -400,7 +400,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Server} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-7.4.2" > Section 7.4.2 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-7.4.2" > Section 7.4.2 of RFC 7231</a>
|
||||
*/
|
||||
String server() {
|
||||
return "Server"
|
||||
@@ -408,7 +408,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Set-Cookie} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc2109#section-4.2.2" > Section 4.2.2 of RFC 2109</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2109#section-4.2.2" > Section 4.2.2 of RFC 2109</a>
|
||||
*/
|
||||
String setCookie() {
|
||||
return "Set-Cookie"
|
||||
@@ -416,7 +416,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Set-Cookie2} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc2965" > RFC 2965</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2965" > RFC 2965</a>
|
||||
*/
|
||||
String setCookie2() {
|
||||
return "Set-Cookie2"
|
||||
@@ -424,7 +424,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code TE} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7230#section-4.3" > Section 4.3 of RFC 7230</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7230#section-4.3" > Section 4.3 of RFC 7230</a>
|
||||
*/
|
||||
String te() {
|
||||
return "TE"
|
||||
@@ -432,7 +432,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Trailer} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7230#section-4.4" > Section 4.4 of RFC 7230</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7230#section-4.4" > Section 4.4 of RFC 7230</a>
|
||||
*/
|
||||
String trailer() {
|
||||
return "Trailer"
|
||||
@@ -440,7 +440,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Transfer-Encoding} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7230#section-3.3.1" > Section 3.3.1 of RFC 7230</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7230#section-3.3.1" > Section 3.3.1 of RFC 7230</a>
|
||||
*/
|
||||
String transferEncoding() {
|
||||
return "Transfer-Encoding"
|
||||
@@ -448,7 +448,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Upgrade} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7230#section-6.7" > Section 6.7 of RFC 7230</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7230#section-6.7" > Section 6.7 of RFC 7230</a>
|
||||
*/
|
||||
String upgrade() {
|
||||
return "Upgrade"
|
||||
@@ -456,7 +456,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code User-Agent} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-5.5.3" > Section 5.5.3 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.5.3" > Section 5.5.3 of RFC 7231</a>
|
||||
*/
|
||||
String user_agent() {
|
||||
return "User-Agent"
|
||||
@@ -464,7 +464,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Vary} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-7.1.4" > Section 7.1.4 of RFC 7231</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-7.1.4" > Section 7.1.4 of RFC 7231</a>
|
||||
*/
|
||||
String vary() {
|
||||
return "Vary"
|
||||
@@ -472,7 +472,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Via} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7230#section-5.7.1" > Section 5.7.1 of RFC 7230</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7230#section-5.7.1" > Section 5.7.1 of RFC 7230</a>
|
||||
*/
|
||||
String via() {
|
||||
return "Via"
|
||||
@@ -480,7 +480,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code Warning} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7234#section-5.5" > Section 5.5 of RFC 7234</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7234#section-5.5" > Section 5.5 of RFC 7234</a>
|
||||
*/
|
||||
String warning() {
|
||||
return "Warning"
|
||||
@@ -488,7 +488,7 @@ class HttpHeaders {
|
||||
|
||||
/**
|
||||
* The HTTP {@code WWW-Authenticate} header field name.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7235#section-4.1" > Section 4.1 of RFC 7235</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7235#section-4.1" > Section 4.1 of RFC 7235</a>
|
||||
*/
|
||||
String wwwAuthenticate() {
|
||||
return "WWW-Authenticate"
|
||||
|
||||
@@ -33,7 +33,7 @@ class HttpStatus {
|
||||
|
||||
/**
|
||||
* {@code 100 Continue}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.2.1" > HTTP/1.1: Semantics and Content, section 6.2.1</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.2.1" > HTTP/1.1: Semantics and Content, section 6.2.1</a>
|
||||
*/
|
||||
int CONTINUE() {
|
||||
return 100
|
||||
@@ -41,19 +41,19 @@ class HttpStatus {
|
||||
|
||||
/**
|
||||
* {@code 101 Switching Protocols}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.2.2" > HTTP/1.1: Semantics and Content, section 6.2.2</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.2.2" > HTTP/1.1: Semantics and Content, section 6.2.2</a>
|
||||
*/
|
||||
int SWITCHING_PROTOCOLS() {
|
||||
return 101
|
||||
}
|
||||
/**
|
||||
* {@code 102 Processing}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc2518#section-10.1" > WebDAV</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2518#section-10.1" > WebDAV</a>
|
||||
*/
|
||||
int PROCESSING() { return 102 }
|
||||
/**
|
||||
* {@code 103 Checkpoint}.
|
||||
* @see <ahref="http://code.google.com/p/gears/wiki/ResumableHttpRequestsProposal" > A proposal for supporting
|
||||
* @see <ahref="https://code.google.com/p/gears/wiki/ResumableHttpRequestsProposal" > A proposal for supporting
|
||||
* resumable POST/PUT HTTP requests in HTTP/1.0</a>
|
||||
*/
|
||||
int CHECKPOINT() { return 103 }
|
||||
@@ -62,52 +62,52 @@ class HttpStatus {
|
||||
|
||||
/**
|
||||
* {@code 200 OK}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.3.1" > HTTP/1.1: Semantics and Content, section 6.3.1</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.3.1" > HTTP/1.1: Semantics and Content, section 6.3.1</a>
|
||||
*/
|
||||
int OK() { return 200 }
|
||||
/**
|
||||
* {@code 201 Created}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.3.2" > HTTP/1.1: Semantics and Content, section 6.3.2</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.3.2" > HTTP/1.1: Semantics and Content, section 6.3.2</a>
|
||||
*/
|
||||
int CREATED() { return 201 }
|
||||
/**
|
||||
* {@code 202 Accepted}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.3.3" > HTTP/1.1: Semantics and Content, section 6.3.3</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.3.3" > HTTP/1.1: Semantics and Content, section 6.3.3</a>
|
||||
*/
|
||||
int ACCEPTED() { return 202 }
|
||||
/**
|
||||
* {@code 203 Non-Authoritative Information}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.3.4" > HTTP/1.1: Semantics and Content, section 6.3.4</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.3.4" > HTTP/1.1: Semantics and Content, section 6.3.4</a>
|
||||
*/
|
||||
int NON_AUTHORITATIVE_INFORMATION() { return 203 }
|
||||
/**
|
||||
* {@code 204 No Content}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.3.5" > HTTP/1.1: Semantics and Content, section 6.3.5</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.3.5" > HTTP/1.1: Semantics and Content, section 6.3.5</a>
|
||||
*/
|
||||
int NO_CONTENT() { return 204 }
|
||||
/**
|
||||
* {@code 205 Reset Content}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.3.6" > HTTP/1.1: Semantics and Content, section 6.3.6</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.3.6" > HTTP/1.1: Semantics and Content, section 6.3.6</a>
|
||||
*/
|
||||
int RESET_CONTENT() { return 205 }
|
||||
/**
|
||||
* {@code 206 Partial Content}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7233#section-4.1" > HTTP/1.1: Range Requests, section 4.1</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7233#section-4.1" > HTTP/1.1: Range Requests, section 4.1</a>
|
||||
*/
|
||||
int PARTIAL_CONTENT() { return 206 }
|
||||
/**
|
||||
* {@code 207 Multi-Status}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc4918#section-13" > WebDAV</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc4918#section-13" > WebDAV</a>
|
||||
*/
|
||||
int MULTI_STATUS() { return 207 }
|
||||
/**
|
||||
* {@code 208 Already Reported}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc5842#section-7.1" > WebDAV Binding Extensions</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc5842#section-7.1" > WebDAV Binding Extensions</a>
|
||||
*/
|
||||
int ALREADY_REPORTED() { return 208 }
|
||||
/**
|
||||
* {@code 226 IM Used}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc3229#section-10.4.1" > Delta encoding in HTTP</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc3229#section-10.4.1" > Delta encoding in HTTP</a>
|
||||
*/
|
||||
int IM_USED() { return 226 }
|
||||
|
||||
@@ -115,51 +115,51 @@ class HttpStatus {
|
||||
|
||||
/**
|
||||
* {@code 300 Multiple Choices}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.4.1" > HTTP/1.1: Semantics and Content, section 6.4.1</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.4.1" > HTTP/1.1: Semantics and Content, section 6.4.1</a>
|
||||
*/
|
||||
int MULTIPLE_CHOICES() { return 300 }
|
||||
/**
|
||||
* {@code 301 Moved Permanently}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.4.2" > HTTP/1.1: Semantics and Content, section 6.4.2</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.4.2" > HTTP/1.1: Semantics and Content, section 6.4.2</a>
|
||||
*/
|
||||
int MOVED_PERMANENTLY() { return 301 }
|
||||
/**
|
||||
* {@code 302 Found}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.4.3" > HTTP/1.1: Semantics and Content, section 6.4.3</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.4.3" > HTTP/1.1: Semantics and Content, section 6.4.3</a>
|
||||
*/
|
||||
int FOUND() { return 302 }
|
||||
/**
|
||||
* {@code 302 Moved Temporarily}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc1945#section-9.3" > HTTP/1.0, section 9.3</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc1945#section-9.3" > HTTP/1.0, section 9.3</a>
|
||||
* @deprecated in favor of {@link #FOUND} which will be returned from {@code HttpStatus.valueOf(302)}
|
||||
*/
|
||||
@Deprecated
|
||||
int MOVED_TEMPORARILY() { return 302 }
|
||||
/**
|
||||
* {@code 303 See Other}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.4.4" > HTTP/1.1: Semantics and Content, section 6.4.4</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.4.4" > HTTP/1.1: Semantics and Content, section 6.4.4</a>
|
||||
*/
|
||||
int SEE_OTHER() { return 303 }
|
||||
/**
|
||||
* {@code 304 Not Modified}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7232#section-4.1" > HTTP/1.1: Conditional Requests, section 4.1</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7232#section-4.1" > HTTP/1.1: Conditional Requests, section 4.1</a>
|
||||
*/
|
||||
int NOT_MODIFIED() { return 304 }
|
||||
/**
|
||||
* {@code 305 Use Proxy}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.4.5" > HTTP/1.1: Semantics and Content, section 6.4.5</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.4.5" > HTTP/1.1: Semantics and Content, section 6.4.5</a>
|
||||
* @deprecated due to security concerns regarding in-band configuration of a proxy
|
||||
*/
|
||||
@Deprecated
|
||||
int USE_PROXY() { return 305 }
|
||||
/**
|
||||
* {@code 307 Temporary Redirect}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.4.7" > HTTP/1.1: Semantics and Content, section 6.4.7</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.4.7" > HTTP/1.1: Semantics and Content, section 6.4.7</a>
|
||||
*/
|
||||
int TEMPORARY_REDIRECT() { return 307 }
|
||||
/**
|
||||
* {@code 308 Permanent Redirect}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7238" > RFC 7238</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7238" > RFC 7238</a>
|
||||
*/
|
||||
int PERMANENT_REDIRECT() { return 308 }
|
||||
|
||||
@@ -167,161 +167,161 @@ class HttpStatus {
|
||||
|
||||
/**
|
||||
* {@code 400 Bad Request}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.5.1" > HTTP/1.1: Semantics and Content, section 6.5.1</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.1" > HTTP/1.1: Semantics and Content, section 6.5.1</a>
|
||||
*/
|
||||
int BAD_REQUEST() { return 400 }
|
||||
/**
|
||||
* {@code 401 Unauthorized}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7235#section-3.1" > HTTP/1.1: Authentication, section 3.1</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7235#section-3.1" > HTTP/1.1: Authentication, section 3.1</a>
|
||||
*/
|
||||
int UNAUTHORIZED() { return 401 }
|
||||
/**
|
||||
* {@code 402 Payment Required}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.5.2" > HTTP/1.1: Semantics and Content, section 6.5.2</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.2" > HTTP/1.1: Semantics and Content, section 6.5.2</a>
|
||||
*/
|
||||
int PAYMENT_REQUIRED() { return 402 }
|
||||
/**
|
||||
* {@code 403 Forbidden}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.5.3" > HTTP/1.1: Semantics and Content, section 6.5.3</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.3" > HTTP/1.1: Semantics and Content, section 6.5.3</a>
|
||||
*/
|
||||
int FORBIDDEN() { return 403 }
|
||||
/**
|
||||
* {@code 404 Not Found}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.5.4" > HTTP/1.1: Semantics and Content, section 6.5.4</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.4" > HTTP/1.1: Semantics and Content, section 6.5.4</a>
|
||||
*/
|
||||
int NOT_FOUND() { return 404 }
|
||||
/**
|
||||
* {@code 405 Method Not Allowed}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.5.5" > HTTP/1.1: Semantics and Content, section 6.5.5</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.5" > HTTP/1.1: Semantics and Content, section 6.5.5</a>
|
||||
*/
|
||||
int METHOD_NOT_ALLOWED() { return 405 }
|
||||
/**
|
||||
* {@code 406 Not Acceptable}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.5.6" > HTTP/1.1: Semantics and Content, section 6.5.6</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.6" > HTTP/1.1: Semantics and Content, section 6.5.6</a>
|
||||
*/
|
||||
int NOT_ACCEPTABLE() { return 406 }
|
||||
/**
|
||||
* {@code 407 Proxy Authentication Required}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7235#section-3.2" > HTTP/1.1: Authentication, section 3.2</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7235#section-3.2" > HTTP/1.1: Authentication, section 3.2</a>
|
||||
*/
|
||||
int PROXY_AUTHENTICATION_REQUIRED() { return 407 }
|
||||
/**
|
||||
* {@code 408 Request Timeout}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.5.7" > HTTP/1.1: Semantics and Content, section 6.5.7</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.7" > HTTP/1.1: Semantics and Content, section 6.5.7</a>
|
||||
*/
|
||||
int REQUEST_TIMEOUT() { return 408 }
|
||||
/**
|
||||
* {@code 409 Conflict}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.5.8" > HTTP/1.1: Semantics and Content, section 6.5.8</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.8" > HTTP/1.1: Semantics and Content, section 6.5.8</a>
|
||||
*/
|
||||
int CONFLICT() { return 409 }
|
||||
/**
|
||||
* {@code 410 Gone}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.5.9" > HTTP/1.1: Semantics and Content, section 6.5.9</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.9" > HTTP/1.1: Semantics and Content, section 6.5.9</a>
|
||||
*/
|
||||
int GONE() { return 410 }
|
||||
/**
|
||||
* {@code 411 Length Required}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.5.10" > HTTP/1.1: Semantics and Content, section 6.5.10</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.10" > HTTP/1.1: Semantics and Content, section 6.5.10</a>
|
||||
*/
|
||||
int LENGTH_REQUIRED() { return 411 }
|
||||
/**
|
||||
* {@code 412 Precondition failed}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7232#section-4.2" > HTTP/1.1: Conditional Requests, section 4.2</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7232#section-4.2" > HTTP/1.1: Conditional Requests, section 4.2</a>
|
||||
*/
|
||||
int PRECONDITION_FAILED() { return 412 }
|
||||
/**
|
||||
* {@code 413 Payload Too Large}.
|
||||
* @since 4.1* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.5.11" > HTTP/1.1: Semantics and Content, section 6.5.11</a>
|
||||
* @since 4.1* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.11" > HTTP/1.1: Semantics and Content, section 6.5.11</a>
|
||||
*/
|
||||
int PAYLOAD_TOO_LARGE() { return 413 }
|
||||
/**
|
||||
* {@code 413 Request Entity Too Large}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc2616#section-10.4.14" > HTTP/1.1, section 10.4.14</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2616#section-10.4.14" > HTTP/1.1, section 10.4.14</a>
|
||||
* @deprecated in favor of {@link #PAYLOAD_TOO_LARGE} which will be returned from {@code HttpStatus.valueOf(413)}
|
||||
*/
|
||||
@Deprecated
|
||||
int REQUEST_ENTITY_TOO_LARGE() { return 413 }
|
||||
/**
|
||||
* {@code 414 URI Too Long}.
|
||||
* @since 4.1* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.5.12" > HTTP/1.1: Semantics and Content, section 6.5.12</a>
|
||||
* @since 4.1* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.12" > HTTP/1.1: Semantics and Content, section 6.5.12</a>
|
||||
*/
|
||||
int URI_TOO_LONG() { return 414 }
|
||||
/**
|
||||
* {@code 414 Request-URI Too Long}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc2616#section-10.4.15" > HTTP/1.1, section 10.4.15</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2616#section-10.4.15" > HTTP/1.1, section 10.4.15</a>
|
||||
* @deprecated in favor of {@link #URI_TOO_LONG} which will be returned from {@code HttpStatus.valueOf(414)}
|
||||
*/
|
||||
@Deprecated
|
||||
int REQUEST_URI_TOO_LONG() { return 414 }
|
||||
/**
|
||||
* {@code 415 Unsupported Media Type}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.5.13" > HTTP/1.1: Semantics and Content, section 6.5.13</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.13" > HTTP/1.1: Semantics and Content, section 6.5.13</a>
|
||||
*/
|
||||
int UNSUPPORTED_MEDIA_TYPE() { return 415 }
|
||||
/**
|
||||
* {@code 416 Requested Range Not Satisfiable}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7233#section-4.4" > HTTP/1.1: Range Requests, section 4.4</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7233#section-4.4" > HTTP/1.1: Range Requests, section 4.4</a>
|
||||
*/
|
||||
int REQUESTED_RANGE_NOT_SATISFIABLE() { return 416 }
|
||||
/**
|
||||
* {@code 417 Expectation Failed}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.5.14" > HTTP/1.1: Semantics and Content, section 6.5.14</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.14" > HTTP/1.1: Semantics and Content, section 6.5.14</a>
|
||||
*/
|
||||
int EXPECTATION_FAILED() { return 417 }
|
||||
/**
|
||||
* {@code 418 I'm a teapot}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc2324#section-2.3.2" > HTCPCP/1.0</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2324#section-2.3.2" > HTCPCP/1.0</a>
|
||||
*/
|
||||
int I_AM_A_TEAPOT() { return 418 }
|
||||
/**
|
||||
* @deprecated See <a href="http://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt">WebDAV Draft Changes</a>
|
||||
* @deprecated See <a href="https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt">WebDAV Draft Changes</a>
|
||||
*/
|
||||
@Deprecated
|
||||
int INSUFFICIENT_SPACE_ON_RESOURCE() { return 419 }
|
||||
/**
|
||||
* @deprecated See <a href="http://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt">WebDAV Draft Changes</a>
|
||||
* @deprecated See <a href="https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt">WebDAV Draft Changes</a>
|
||||
*/
|
||||
@Deprecated
|
||||
int METHOD_FAILURE() { return 420 }
|
||||
/**
|
||||
* @deprecated See <a href="http://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt">WebDAV Draft Changes</a>
|
||||
* @deprecated See <a href="https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt">WebDAV Draft Changes</a>
|
||||
*/
|
||||
@Deprecated
|
||||
int DESTINATION_LOCKED() { return 421 }
|
||||
/**
|
||||
* {@code 422 Unprocessable Entity}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc4918#section-11.2" > WebDAV</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc4918#section-11.2" > WebDAV</a>
|
||||
*/
|
||||
int UNPROCESSABLE_ENTITY() { return 422 }
|
||||
/**
|
||||
* {@code 423 Locked}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc4918#section-11.3" > WebDAV</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc4918#section-11.3" > WebDAV</a>
|
||||
*/
|
||||
int LOCKED() { return 423 }
|
||||
/**
|
||||
* {@code 424 Failed Dependency}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc4918#section-11.4" > WebDAV</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc4918#section-11.4" > WebDAV</a>
|
||||
*/
|
||||
int FAILED_DEPENDENCY() { return 424 }
|
||||
/**
|
||||
* {@code 426 Upgrade Required}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc2817#section-6" > Upgrading to TLS Within HTTP/1.1</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2817#section-6" > Upgrading to TLS Within HTTP/1.1</a>
|
||||
*/
|
||||
int UPGRADE_REQUIRED() { return 426 }
|
||||
/**
|
||||
* {@code 428 Precondition Required}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc6585#section-3" > Additional HTTP Status Codes</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc6585#section-3" > Additional HTTP Status Codes</a>
|
||||
*/
|
||||
int PRECONDITION_REQUIRED() { return 428 }
|
||||
/**
|
||||
* {@code 429 Too Many Requests}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc6585#section-4" > Additional HTTP Status Codes</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc6585#section-4" > Additional HTTP Status Codes</a>
|
||||
*/
|
||||
int TOO_MANY_REQUESTS() { return 429 }
|
||||
/**
|
||||
* {@code 431 Request Header Fields Too Large}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc6585#section-5" > Additional HTTP Status Codes</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc6585#section-5" > Additional HTTP Status Codes</a>
|
||||
*/
|
||||
int REQUEST_HEADER_FIELDS_TOO_LARGE() { return 431 }
|
||||
/**
|
||||
@@ -336,47 +336,47 @@ class HttpStatus {
|
||||
|
||||
/**
|
||||
* {@code 500 Internal Server Error}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.6.1" > HTTP/1.1: Semantics and Content, section 6.6.1</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.6.1" > HTTP/1.1: Semantics and Content, section 6.6.1</a>
|
||||
*/
|
||||
int INTERNAL_SERVER_ERROR() { return 500 }
|
||||
/**
|
||||
* {@code 501 Not Implemented}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.6.2" > HTTP/1.1: Semantics and Content, section 6.6.2</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.6.2" > HTTP/1.1: Semantics and Content, section 6.6.2</a>
|
||||
*/
|
||||
int NOT_IMPLEMENTED() { return 501 }
|
||||
/**
|
||||
* {@code 502 Bad Gateway}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.6.3" > HTTP/1.1: Semantics and Content, section 6.6.3</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.6.3" > HTTP/1.1: Semantics and Content, section 6.6.3</a>
|
||||
*/
|
||||
int BAD_GATEWAY() { return 502 }
|
||||
/**
|
||||
* {@code 503 Service Unavailable}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.6.4" > HTTP/1.1: Semantics and Content, section 6.6.4</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.6.4" > HTTP/1.1: Semantics and Content, section 6.6.4</a>
|
||||
*/
|
||||
int SERVICE_UNAVAILABLE() { return 503 }
|
||||
/**
|
||||
* {@code 504 Gateway Timeout}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.6.5" > HTTP/1.1: Semantics and Content, section 6.6.5</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.6.5" > HTTP/1.1: Semantics and Content, section 6.6.5</a>
|
||||
*/
|
||||
int GATEWAY_TIMEOUT() { return 504 }
|
||||
/**
|
||||
* {@code 505 HTTP Version Not Supported}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc7231#section-6.6.6" > HTTP/1.1: Semantics and Content, section 6.6.6</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.6.6" > HTTP/1.1: Semantics and Content, section 6.6.6</a>
|
||||
*/
|
||||
int HTTP_VERSION_NOT_SUPPORTED() { return 505 }
|
||||
/**
|
||||
* {@code 506 Variant Also Negotiates}
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc2295#section-8.1" > Transparent Content Negotiation</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2295#section-8.1" > Transparent Content Negotiation</a>
|
||||
*/
|
||||
int VARIANT_ALSO_NEGOTIATES() { return 506 }
|
||||
/**
|
||||
* {@code 507 Insufficient Storage}
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc4918#section-11.5" > WebDAV</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc4918#section-11.5" > WebDAV</a>
|
||||
*/
|
||||
int INSUFFICIENT_STORAGE() { return 507 }
|
||||
/**
|
||||
* {@code 508 Loop Detected}
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc5842#section-7.2" > WebDAV Binding Extensions</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc5842#section-7.2" > WebDAV Binding Extensions</a>
|
||||
*/
|
||||
int LOOP_DETECTED() { return 508 }
|
||||
/**
|
||||
@@ -385,12 +385,12 @@ class HttpStatus {
|
||||
int BANDWIDTH_LIMIT_EXCEEDED() { return 509 }
|
||||
/**
|
||||
* {@code 510 Not Extended}
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc2774#section-7" > HTTP Extension Framework</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2774#section-7" > HTTP Extension Framework</a>
|
||||
*/
|
||||
int NOT_EXTENDED() { return 510 }
|
||||
/**
|
||||
* {@code 511 Network Authentication Required}.
|
||||
* @see <ahref="http://tools.ietf.org/html/rfc6585#section-6" > Additional HTTP Status Codes</a>
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc6585#section-6" > Additional HTTP Status Codes</a>
|
||||
*/
|
||||
int NETWORK_AUTHENTICATION_REQUIRED() { return 511 }
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ class UrlHelper {
|
||||
|
||||
// Examples: "fitbit.com", "22.231.113.64", "localhost"
|
||||
private static final String REGEX_HOST = "(?:" +
|
||||
// @Author = http://www.regular-expressions.info/examples.html
|
||||
// @Author = https://www.regular-expressions.info/examples.html
|
||||
// IP address
|
||||
"(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" +
|
||||
"|" +
|
||||
|
||||
@@ -54,59 +54,59 @@ class RegexPatternsSpec extends Specification {
|
||||
'asdf@asdf.online' || true
|
||||
}
|
||||
|
||||
// @see http://formvalidation.io/validators/uri/
|
||||
// @see https://formvalidation.io/validators/uri/
|
||||
def "should generate a regex for url [#textToMatch] that is a match [#shouldMatch]"() {
|
||||
expect:
|
||||
shouldMatch == regexPatterns.url().matcher(textToMatch).matches()
|
||||
where:
|
||||
textToMatch || shouldMatch
|
||||
'ftp://asd.com:9090/asd/a?a=b' || true
|
||||
'http://foo.com/blah_blah' || true
|
||||
'http://www.foo.com/blah_blah' || true
|
||||
'ftp://localhost/api' || true
|
||||
'http://localhost:8080/api' || true
|
||||
'http://foo.com/blah_blah/' || true
|
||||
'http://foo.com/blah_blah_(wikipedia)' || true
|
||||
'http://foo.com/blah_blah_(wikipedia)_(again)' || true
|
||||
'http://www.example.com/wpstyle/?p=364' || true
|
||||
'http://www.foo.com/blah_blah/' || true
|
||||
'http://www.foo.com/blah_blah_(wikipedia)' || true
|
||||
'http://www.foo.com/blah_blah_(wikipedia)_(again)' || true
|
||||
'https://www.example.com/wpstyle/?p=364' || true
|
||||
'https://www.example.com/foo/?bar=baz&inga=42&quux' || true
|
||||
'http://✪df.ws/123' || true
|
||||
'http://userid:password@example.com:8080' || true
|
||||
'http://userid:password@example.com:8080/' || true
|
||||
'http://userid@example.com' || true
|
||||
'http://userid@example.com/' || true
|
||||
'http://userid@example.com:8080' || true
|
||||
'http://userid@example.com:8080/' || true
|
||||
'http://userid:password@example.com' || true
|
||||
'http://userid:password@example.com/' || true
|
||||
'http://142.42.1.1/' || true
|
||||
'http://142.42.1.1:8080/' || true
|
||||
'https://userid:password@example.com:8080' || true
|
||||
'https://userid:password@example.com:8080/' || true
|
||||
'https://userid@example.com' || true
|
||||
'https://userid@example.com/' || true
|
||||
'https://userid@example.com:8080' || true
|
||||
'https://userid@example.com:8080/' || true
|
||||
'https://userid:password@example.com' || true
|
||||
'https://userid:password@example.com/' || true
|
||||
'https://142.42.1.1/' || true
|
||||
'https://142.42.1.1:8080/' || true
|
||||
'http://⌘.ws' || true
|
||||
'http://⌘.ws/' || true
|
||||
'http://foo.com/blah_(wikipedia)#cite-1' || true
|
||||
'http://foo.com/blah_(wikipedia)_blah#cite-1' || true
|
||||
'http://foo.com/unicode_(✪)_in_parens' || true
|
||||
'http://foo.com/(something)?after=parens' || true
|
||||
'http://www.foo.com/blah_(wikipedia)#cite-1' || true
|
||||
'http://www.foo.com/blah_(wikipedia)_blah#cite-1' || true
|
||||
'http://www.foo.com/unicode_(✪)_in_parens' || true
|
||||
'http://www.foo.com/(something)?after=parens' || true
|
||||
'http://☺.damowmow.com/' || true
|
||||
'http://code.google.com/events/#&product=browser' || true
|
||||
'http://j.mp' || true
|
||||
'https://code.google.com/events/#&product=browser' || true
|
||||
'https://j.mp' || true
|
||||
'ftp://foo.bar/baz' || true
|
||||
'http://foo.bar/?q=Test%20URL-encoded%20stuff' || true
|
||||
'http://1337.net' || true
|
||||
'http://a.b-c.de' || true
|
||||
'http://223.255.255.254' || true
|
||||
'https://foo.bar/?q=Test%20URL-encoded%20stuff' || true
|
||||
'https://1224.net/' || true
|
||||
'https://a.b-c.de' || true
|
||||
'https://223.255.255.254' || true
|
||||
'foo.com' || true
|
||||
'a.b.' || false
|
||||
'http://' || false
|
||||
'http://.' || false
|
||||
'http://..' || false
|
||||
'http://../' || false
|
||||
'https://../' || false
|
||||
'http://?' || false
|
||||
'http://??' || false
|
||||
'http://??/' || false
|
||||
'http://#' || false
|
||||
'http://##' || false
|
||||
'http://##/' || false
|
||||
'http://foo.bar?q=Spaces should be encoded' || false
|
||||
'https://foo.bar?q=Spaces should be encoded' || false
|
||||
'//' || false
|
||||
'//a' || false
|
||||
'///a' || false
|
||||
@@ -116,16 +116,16 @@ class RegexPatternsSpec extends Specification {
|
||||
'h://test' || false
|
||||
'http:// shouldfail.com' || false
|
||||
':// should fail' || false
|
||||
'http://foo.bar/foo(bar)baz quux' || false
|
||||
'http://-error-.invalid/' || false
|
||||
'http://-a.b.co' || false
|
||||
'http://a.b-.co' || false
|
||||
'http://1.1.1.1.1' || false
|
||||
'http://123.123.123' || false
|
||||
'https://foo.bar/foo(bar)baz quux' || false
|
||||
'https://-error-.invalid/' || false
|
||||
'https://-a.b.co' || false
|
||||
'https://a.b-.co' || false
|
||||
'https://1.1.1.1.1' || false
|
||||
'https://123.123.123' || false
|
||||
'http://3628126748' || false
|
||||
'http://.www.foo.bar/' || false
|
||||
'http://www.foo.bar./' || false
|
||||
'http://.www.foo.bar./' || false
|
||||
'https://.www.foo.bar/' || false
|
||||
'https://www.foo.bar./' || false
|
||||
'https://.www.foo.bar./' || false
|
||||
}
|
||||
|
||||
def "should generate a regex for httpsUrl [#textToMatch] that is a match [#shouldMatch]"() {
|
||||
@@ -136,8 +136,8 @@ class RegexPatternsSpec extends Specification {
|
||||
'ftp://asd.com:9090/asd/a?a=b' || false
|
||||
'https://foo.com/blah_blah/' || true
|
||||
'https://foo.com/blah_blah' || true
|
||||
'http://foo.com/blah_blah' || false
|
||||
'http://foo.com/blah_blah/' || false
|
||||
'http://www.foo.com/blah_blah' || false
|
||||
'http://www.foo.com/blah_blah/' || false
|
||||
'https://foo.com/blah_blah_(wikipedia)' || true
|
||||
'https://foo.com/blah_blah_(wikipedia)_(again)' || true
|
||||
'https://www.example.com/wpstyle/?p=364' || true
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
=== Stub Runner Core
|
||||
|
||||
Runs stubs for service collaborators. Treating stubs as contracts of services allows to use stub-runner as an implementation of
|
||||
http://martinfowler.com/articles/consumerDrivenContracts.html[Consumer Driven Contracts].
|
||||
https://martinfowler.com/articles/consumerDrivenContracts.html[Consumer Driven Contracts].
|
||||
|
||||
Stub Runner allows you to automatically download the stubs of the provided dependencies (or pick those from the classpath), start WireMock servers for them and feed them with proper stub definitions.
|
||||
For messaging, special stub routes are defined.
|
||||
@@ -32,7 +32,7 @@ Example:
|
||||
|
||||
[source,java]
|
||||
----
|
||||
@AutoConfigureStubRunner(repositoryRoot="http://foo.bar", ids = "com.example:beer-api-producer:+:stubs:8095", stubsMode = StubRunnerProperties.StubsMode.LOCAL)
|
||||
@AutoConfigureStubRunner(repositoryRoot="https://foo.bar", ids = "com.example:beer-api-producer:+:stubs:8095", stubsMode = StubRunnerProperties.StubsMode.LOCAL)
|
||||
----
|
||||
|
||||
===== Classpath scanning
|
||||
@@ -539,7 +539,7 @@ $ java -jar stub-runner.jar --stubrunner.ids=... --stubrunner.repositoryRoot=...
|
||||
|
||||
===== Spring Cloud CLI
|
||||
|
||||
Starting from `1.4.0.RELEASE` version of the http://cloud.spring.io/spring-cloud-cli[Spring Cloud CLI]
|
||||
Starting from `1.4.0.RELEASE` version of the https://cloud.spring.io/spring-cloud-cli[Spring Cloud CLI]
|
||||
project you can start Stub Runner Boot by executing `spring cloud stubrunner`.
|
||||
|
||||
In order to pass the configuration just create a `stubrunner.yml` file in the current working directory
|
||||
|
||||
@@ -64,7 +64,7 @@ public class StubRunnerMain {
|
||||
ArgumentAcceptingOptionSpec<String> rootOpt = parser.acceptsAll(
|
||||
Arrays.asList("r", "root"),
|
||||
"Location of a Jar containing server where you keep "
|
||||
+ "your stubs (e.g. http://nexus.net/content/repositories/repository)")
|
||||
+ "your stubs (e.g. https://nexus.net/content/repositories/repository)")
|
||||
.withRequiredArg();
|
||||
ArgumentAcceptingOptionSpec<String> usernameOpt = parser
|
||||
.acceptsAll(Arrays.asList("u", "username"),
|
||||
|
||||
@@ -42,7 +42,7 @@ public class StubRunnerBootEurekaExample {
|
||||
/*
|
||||
*
|
||||
* // tag::stubrunnereureka_args[]
|
||||
* -Dstubrunner.repositoryRoot=https://repo.spring.io/snapshots (1)
|
||||
* -Dstubrunner.repositoryRoot=https://repo.spring.io/snapshot (1)
|
||||
* -Dstubrunner.cloud.stubbed.discovery.enabled=false (2)
|
||||
* -Dstubrunner.ids=org.springframework.cloud.contract.verifier.stubs:loanIssuance,org.
|
||||
* springframework.cloud.contract.verifier.stubs:fraudDetectionServer,org.springframework.
|
||||
|
||||
@@ -76,8 +76,8 @@ public class GitStubDownloaderTests {
|
||||
StubDownloader stubDownloader = stubDownloaderBuilder
|
||||
.build(new StubRunnerOptionsBuilder()
|
||||
.withStubsMode(StubRunnerProperties.StubsMode.REMOTE)
|
||||
.withStubRepositoryRoot("http://foo.com").withProperties(props())
|
||||
.build());
|
||||
.withStubRepositoryRoot("http://www.foo.com/")
|
||||
.withProperties(props()).build());
|
||||
|
||||
then(stubDownloader).isNull();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
https://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
https://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud.contract.verifier.stubs</groupId>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud.contract.verifier.stubs</groupId>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud.contract.verifier.stubs</groupId>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud.contract.verifier.stubs</groupId>
|
||||
|
||||
@@ -289,7 +289,7 @@ class DslToWireMockClientConverterSpec extends Specification {
|
||||
"id":"01fbe706f872cb32",
|
||||
"name":"Washington",
|
||||
"place_type":"city",
|
||||
"url": "http://api.twitter.com/1/geo/id/01fbe706f872cb32.json"
|
||||
"url": "https://api.twitter.com/1/geo/id/01fbe706f872cb32.json"
|
||||
}
|
||||
}]
|
||||
'''
|
||||
@@ -329,7 +329,7 @@ class DslToWireMockClientConverterSpec extends Specification {
|
||||
}, {
|
||||
"matchesJsonPath" : "$[*].['place'].['bounding_box'][?(@.['type'] == 'Polygon')]"
|
||||
}, {
|
||||
"matchesJsonPath" : "$[*].['place'][?(@.['url'] == 'http://api.twitter.com/1/geo/id/01fbe706f872cb32.json')]"
|
||||
"matchesJsonPath" : "$[*].['place'][?(@.['url'] == 'https://api.twitter.com/1/geo/id/01fbe706f872cb32.json')]"
|
||||
}, {
|
||||
"matchesJsonPath" : "$[*].['place'].['bounding_box'].['coordinates'][*][*][?(@ == 38.995548)]"
|
||||
}, {
|
||||
@@ -385,7 +385,7 @@ class DslToWireMockClientConverterSpec extends Specification {
|
||||
"id":"01fbe706f872cb32",
|
||||
"name":"Washington",
|
||||
"place_type":"city",
|
||||
"url": "http://api.twitter.com/1/geo/id/01fbe706f872cb32.json"
|
||||
"url": "https://api.twitter.com/1/geo/id/01fbe706f872cb32.json"
|
||||
}
|
||||
}]'''), String)
|
||||
}
|
||||
@@ -488,7 +488,7 @@ class DslToWireMockClientConverterSpec extends Specification {
|
||||
}
|
||||
body(
|
||||
email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
|
||||
callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
|
||||
callback_url: $(consumer(regex(hostname())), producer('https://partners.com'))
|
||||
)
|
||||
}
|
||||
response {
|
||||
@@ -543,7 +543,7 @@ class DslToWireMockClientConverterSpec extends Specification {
|
||||
and:
|
||||
def response = restTemplate.exchange(RequestEntity.post("${url}/users/password".toURI())
|
||||
.header("Content-Type", "application/json")
|
||||
.body('''{"email":"abc@abc.com", "callback_url":"http://partners.com"}''')
|
||||
.body('''{"email":"abc@abc.com", "callback_url":"https://partners.com"}''')
|
||||
, String)
|
||||
response.headers.get('Content-Type') == ['application/json']
|
||||
response.statusCodeValue == 404
|
||||
@@ -846,7 +846,7 @@ class DslToWireMockClientConverterSpec extends Specification {
|
||||
}
|
||||
body(
|
||||
email: 'abc@abc.com',
|
||||
callback_url: 'http://partners.com'
|
||||
callback_url: 'https://partners.com'
|
||||
)
|
||||
bodyMatchers {
|
||||
jsonPath('$.[\\'email\\']', byRegex(email()))
|
||||
@@ -908,7 +908,7 @@ class DslToWireMockClientConverterSpec extends Specification {
|
||||
and:
|
||||
def response = restTemplate.exchange(RequestEntity.post("${url}/users/password2".toURI())
|
||||
.header("Content-Type", "application/json")
|
||||
.body('''{"email":"abc@abc.com", "callback_url":"http://partners.com"}''')
|
||||
.body('''{"email":"abc@abc.com", "callback_url":"https://partners.com"}''')
|
||||
, String)
|
||||
response.headers.get('Content-Type') == ['application/json']
|
||||
response.statusCodeValue == 404
|
||||
@@ -932,7 +932,7 @@ class DslToWireMockClientConverterSpec extends Specification {
|
||||
}
|
||||
body(
|
||||
email: 'abc@abc.com',
|
||||
callback_url: 'http://partners.com'
|
||||
callback_url: 'https://partners.com'
|
||||
)
|
||||
bodyMatchers {
|
||||
jsonPath('$.[\\'email\\']', byRegex(email()))
|
||||
@@ -1006,7 +1006,7 @@ class DslToWireMockClientConverterSpec extends Specification {
|
||||
and:
|
||||
def response = restTemplate.exchange(RequestEntity.post("${url}/users/password2".toURI())
|
||||
.header("Content-Type", "application/json")
|
||||
.body('''{"email":"abc@abc.com", "callback_url":"http://partners.com"}''')
|
||||
.body('''{"email":"abc@abc.com", "callback_url":"https://partners.com"}''')
|
||||
, String)
|
||||
response.headers.get('Content-Type') == ['application/json;charset=UTF-8']
|
||||
response.statusCodeValue == 400
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
-->
|
||||
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.example</groupId>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#WireMock password - http://wiremock.org/docs/running-standalone/
|
||||
#WireMock password - https://wiremock.org/docs/running-standalone/
|
||||
server.ssl.key-store-password=password
|
||||
server.ssl.key-password=password
|
||||
server.ssl.trust-store-password=password
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.example</groupId>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.example</groupId>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.example</groupId>
|
||||
|
||||
@@ -99,7 +99,7 @@ class TestSideRequestTemplateModel {
|
||||
}
|
||||
|
||||
private static List<String> buildPathsFromUrl(String url) {
|
||||
String fakeUrl = "http://foo.bar" + (url.startsWith("/") ? url : "/" + url)
|
||||
String fakeUrl = "https://foo.bar" + (url.startsWith("/") ? url : "/" + url)
|
||||
List<String> paths = new URL(fakeUrl).path.split("/") as List<String>
|
||||
if (!paths.isEmpty()) {
|
||||
paths.remove(0)
|
||||
|
||||
@@ -287,7 +287,7 @@ class ContractHttpDocsSpec extends Specification {
|
||||
}
|
||||
body(
|
||||
email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
|
||||
callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
|
||||
callback_url: $(consumer(regex(hostname())), producer('https://partners.com'))
|
||||
)
|
||||
}
|
||||
response {
|
||||
@@ -315,7 +315,7 @@ class ContractHttpDocsSpec extends Specification {
|
||||
given:
|
||||
def request = given()
|
||||
.header("Content-Type", "application/json")
|
||||
.body('''{"email":"abc@abc.com","callback_url":"http://partners.com"}''')
|
||||
.body('''{"email":"abc@abc.com","callback_url":"https://partners.com"}''')
|
||||
|
||||
when:
|
||||
def response = given().spec(request)
|
||||
|
||||
@@ -1184,7 +1184,7 @@ class JaxRsClientMethodBuilderSpec extends Specification implements WireMockStub
|
||||
SyntaxChecker.tryToCompile(methodBuilderName, blockBuilder.toString())
|
||||
and:
|
||||
String jsonSample = '''\
|
||||
String json = "{\\"duck\\":\\"8\\",\\"alpha\\":\\"YAJEOWYGMFBEWPMEMAZI\\",\\"number\\":-2095030871,\\"positiveInt\\":42,\\"aDouble\\":42.345,\\"aBoolean\\":true,\\"ip\\":\\"129.168.99.100\\",\\"hostname\\":\\"http://foo389886219.com\\",\\"email\\":\\"foo@bar1367573183.com\\",\\"url\\":\\"http://foo-597104692.com\\",\\"httpsUrl\\":\\"https://baz-486093581.com\\",\\"uuid\\":\\"e436b817-b764-49a2-908e-967f2f99eb9f\\",\\"date\\":\\"2014-04-14\\",\\"dateTime\\":\\"2011-01-11T12:23:34\\",\\"time\\":\\"12:20:30\\",\\"iso8601WithOffset\\":\\"2015-05-15T12:23:34.123Z\\",\\"nonBlankString\\":\\"EPZWVIRHSUAPBJMMQSFO\\",\\"nonEmptyString\\":\\"RVMFDSEQFHRQFVUVQPIA\\",\\"anyOf\\":\\"foo\\"}";
|
||||
String json = "{\\"duck\\":\\"8\\",\\"alpha\\":\\"YAJEOWYGMFBEWPMEMAZI\\",\\"number\\":-2095030871,\\"positiveInt\\":42,\\"aDouble\\":42.345,\\"aBoolean\\":true,\\"ip\\":\\"129.168.99.100\\",\\"hostname\\":\\"https://foo389886219.com\\",\\"email\\":\\"foo@bar1367573183.com\\",\\"url\\":\\"https://foo-597104692.com\\",\\"httpsUrl\\":\\"https://baz-486093581.com\\",\\"uuid\\":\\"e436b817-b764-49a2-908e-967f2f99eb9f\\",\\"date\\":\\"2014-04-14\\",\\"dateTime\\":\\"2011-01-11T12:23:34\\",\\"time\\":\\"12:20:30\\",\\"iso8601WithOffset\\":\\"2015-05-15T12:23:34.123Z\\",\\"nonBlankString\\":\\"EPZWVIRHSUAPBJMMQSFO\\",\\"nonEmptyString\\":\\"RVMFDSEQFHRQFVUVQPIA\\",\\"anyOf\\":\\"foo\\"}";
|
||||
DocumentContext parsedJson = JsonPath.parse(json);
|
||||
'''
|
||||
and:
|
||||
|
||||
@@ -603,7 +603,7 @@ then:
|
||||
!test.contains('REGEXP>>')
|
||||
and:
|
||||
String jsonSample = '''\
|
||||
String json = "{\\"shouldFail\\":123,\\"duck\\":\\"8\\",\\"alpha\\":\\"YAJEOWYGMFBEWPMEMAZI\\",\\"number\\":-2095030871,\\"anInteger\\":1780305902,\\"positiveInt\\":345,\\"aDouble\\":42.345,\\"aBoolean\\":true,\\"ip\\":\\"129.168.99.100\\",\\"hostname\\":\\"http://foo389886219.com\\",\\"email\\":\\"foo@bar1367573183.com\\",\\"url\\":\\"http://foo-597104692.com\\",\\"httpsUrl\\":\\"https://baz-486093581.com\\",\\"uuid\\":\\"e436b817-b764-49a2-908e-967f2f99eb9f\\",\\"date\\":\\"2014-04-14\\",\\"dateTime\\":\\"2011-01-11T12:23:34\\",\\"time\\":\\"12:20:30\\",\\"iso8601WithOffset\\":\\"2015-05-15T12:23:34.123Z\\",\\"nonBlankString\\":\\"EPZWVIRHSUAPBJMMQSFO\\",\\"nonEmptyString\\":\\"RVMFDSEQFHRQFVUVQPIA\\",\\"anyOf\\":\\"foo\\"}";
|
||||
String json = "{\\"shouldFail\\":123,\\"duck\\":\\"8\\",\\"alpha\\":\\"YAJEOWYGMFBEWPMEMAZI\\",\\"number\\":-2095030871,\\"anInteger\\":1780305902,\\"positiveInt\\":345,\\"aDouble\\":42.345,\\"aBoolean\\":true,\\"ip\\":\\"129.168.99.100\\",\\"hostname\\":\\"https://foo389886219.com\\",\\"email\\":\\"foo@bar1367573183.com\\",\\"url\\":\\"https://foo-597104692.com\\",\\"httpsUrl\\":\\"https://baz-486093581.com\\",\\"uuid\\":\\"e436b817-b764-49a2-908e-967f2f99eb9f\\",\\"date\\":\\"2014-04-14\\",\\"dateTime\\":\\"2011-01-11T12:23:34\\",\\"time\\":\\"12:20:30\\",\\"iso8601WithOffset\\":\\"2015-05-15T12:23:34.123Z\\",\\"nonBlankString\\":\\"EPZWVIRHSUAPBJMMQSFO\\",\\"nonEmptyString\\":\\"RVMFDSEQFHRQFVUVQPIA\\",\\"anyOf\\":\\"foo\\"}";
|
||||
DocumentContext parsedJson = JsonPath.parse(json);
|
||||
'''
|
||||
and:
|
||||
|
||||
@@ -1970,7 +1970,7 @@ World.'''"""
|
||||
"id":"01fbe706f872cb32",
|
||||
"name":"Washington",
|
||||
"place_type":"city",
|
||||
"url": "http://api.twitter.com/1/geo/id/01fbe706f872cb32.json"
|
||||
"url": "https://api.twitter.com/1/geo/id/01fbe706f872cb32.json"
|
||||
}
|
||||
}]
|
||||
'''
|
||||
@@ -2332,7 +2332,7 @@ World.'''"""
|
||||
SyntaxChecker.tryToCompile(methodBuilderName, blockBuilder.toString())
|
||||
and:
|
||||
String jsonSample = '''\
|
||||
String json = "{\\"duck\\":\\"8\\",\\"alpha\\":\\"YAJEOWYGMFBEWPMEMAZI\\",\\"number\\":-2095030871,\\"anInteger\\":1780305902,\\"positiveInt\\":345,\\"aDouble\\":42.345,\\"aBoolean\\":true,\\"ip\\":\\"129.168.99.100\\",\\"hostname\\":\\"http://foo389886219.com\\",\\"email\\":\\"foo@bar1367573183.com\\",\\"url\\":\\"http://foo-597104692.com\\",\\"httpsUrl\\":\\"https://baz-486093581.com\\",\\"uuid\\":\\"e436b817-b764-49a2-908e-967f2f99eb9f\\",\\"date\\":\\"2014-04-14\\",\\"dateTime\\":\\"2011-01-11T12:23:34\\",\\"time\\":\\"12:20:30\\",\\"iso8601WithOffset\\":\\"2015-05-15T12:23:34.123Z\\",\\"nonBlankString\\":\\"EPZWVIRHSUAPBJMMQSFO\\",\\"nonEmptyString\\":\\"RVMFDSEQFHRQFVUVQPIA\\",\\"anyOf\\":\\"foo\\"}";
|
||||
String json = "{\\"duck\\":\\"8\\",\\"alpha\\":\\"YAJEOWYGMFBEWPMEMAZI\\",\\"number\\":-2095030871,\\"anInteger\\":1780305902,\\"positiveInt\\":345,\\"aDouble\\":42.345,\\"aBoolean\\":true,\\"ip\\":\\"129.168.99.100\\",\\"hostname\\":\\"https://foo389886219.com\\",\\"email\\":\\"foo@bar1367573183.com\\",\\"url\\":\\"https://foo-597104692.com\\",\\"httpsUrl\\":\\"https://baz-486093581.com\\",\\"uuid\\":\\"e436b817-b764-49a2-908e-967f2f99eb9f\\",\\"date\\":\\"2014-04-14\\",\\"dateTime\\":\\"2011-01-11T12:23:34\\",\\"time\\":\\"12:20:30\\",\\"iso8601WithOffset\\":\\"2015-05-15T12:23:34.123Z\\",\\"nonBlankString\\":\\"EPZWVIRHSUAPBJMMQSFO\\",\\"nonEmptyString\\":\\"RVMFDSEQFHRQFVUVQPIA\\",\\"anyOf\\":\\"foo\\"}";
|
||||
DocumentContext parsedJson = JsonPath.parse(json);
|
||||
'''
|
||||
and:
|
||||
|
||||
@@ -1365,7 +1365,7 @@ class WireMockGroovyDslSpec extends Specification implements WireMockStubVerifie
|
||||
}
|
||||
body(
|
||||
email: $(consumer(regex(email())), producer('not.existing@user.com')),
|
||||
callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
|
||||
callback_url: $(consumer(regex(hostname())), producer('https://partners.com'))
|
||||
)
|
||||
}
|
||||
response {
|
||||
@@ -1504,7 +1504,7 @@ class WireMockGroovyDslSpec extends Specification implements WireMockStubVerifie
|
||||
}
|
||||
body(
|
||||
email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
|
||||
callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
|
||||
callback_url: $(consumer(regex(hostname())), producer('https://partners.com'))
|
||||
)
|
||||
}
|
||||
response {
|
||||
@@ -1529,7 +1529,7 @@ class WireMockGroovyDslSpec extends Specification implements WireMockStubVerifie
|
||||
body(
|
||||
""" {
|
||||
"email" : "${value(consumer(optional(regex(email()))), producer('abc@abc.com'))}",
|
||||
"callback_url" : "${value(consumer(regex(hostname())), producer('http://partners.com'))}"
|
||||
"callback_url" : "${value(consumer(regex(hostname())), producer('https://partners.com'))}"
|
||||
}
|
||||
"""
|
||||
)
|
||||
|
||||
@@ -39,9 +39,9 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void simpleGet() throws Exception {
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/resource.json").build();
|
||||
assertThat(this.restTemplate.getForObject("http://example.org/resource",
|
||||
assertThat(this.restTemplate.getForObject("https://example.org/resource",
|
||||
String.class)).isEqualTo("Hello World");
|
||||
server.verify();
|
||||
}
|
||||
@@ -49,10 +49,10 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void simplePutShouldFail() throws Exception {
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/resource.json").build();
|
||||
RequestEntity<Void> postRequest = RequestEntity
|
||||
.post(URI.create("http://example.org/resource"))
|
||||
.post(URI.create("https://example.org/resource"))
|
||||
.accept(MediaType.TEXT_PLAIN).build();
|
||||
ResponseEntity<String> response;
|
||||
try {
|
||||
@@ -70,9 +70,9 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void simpleGetWithBodyFile() throws Exception {
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/resource-with-body-file.json").build();
|
||||
assertThat(this.restTemplate.getForObject("http://example.org/resource",
|
||||
assertThat(this.restTemplate.getForObject("https://example.org/resource",
|
||||
String.class))
|
||||
.isEqualToIgnoringWhitespace("{\"message\":\"Hello World\"}");
|
||||
server.verify();
|
||||
@@ -81,10 +81,10 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void simpleGetWithBodyFileCustomLocation() throws Exception {
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/resource-with-body-file.json")
|
||||
.files("classpath:/custom/").build();
|
||||
assertThat(this.restTemplate.getForObject("http://example.org/resource",
|
||||
assertThat(this.restTemplate.getForObject("https://example.org/resource",
|
||||
String.class))
|
||||
.isEqualToIgnoringWhitespace("{\"message\":\"Hello Custom\"}");
|
||||
server.verify();
|
||||
@@ -93,10 +93,10 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void simpleGetWithBodyFileCustomLocationDirectory() throws Exception {
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/resource-with-body-file.json")
|
||||
.files("file:src/test/resources/custom").build();
|
||||
assertThat(this.restTemplate.getForObject("http://example.org/resource",
|
||||
assertThat(this.restTemplate.getForObject("https://example.org/resource",
|
||||
String.class))
|
||||
.isEqualToIgnoringWhitespace("{\"message\":\"Hello Custom\"}");
|
||||
server.verify();
|
||||
@@ -105,9 +105,9 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void simpleGetWithEmptyPath() throws Exception {
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/resource-with-empty-path.json").build();
|
||||
assertThat(this.restTemplate.getForObject("http://example.org/", String.class))
|
||||
assertThat(this.restTemplate.getForObject("https://example.org/", String.class))
|
||||
.isEqualTo("Hello World");
|
||||
server.verify();
|
||||
}
|
||||
@@ -115,9 +115,9 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void simpleGetWithContentType() throws Exception {
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/resource-with-content-type.json").build();
|
||||
assertThat(this.restTemplate.getForObject("http://example.org/resource",
|
||||
assertThat(this.restTemplate.getForObject("https://example.org/resource",
|
||||
String.class)).isEqualTo("Hello World");
|
||||
server.verify();
|
||||
}
|
||||
@@ -125,9 +125,9 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void simpleGetWithoutContentType() throws Exception {
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/resource-without-content-type.json").build();
|
||||
assertThat(this.restTemplate.getForObject("http://example.org/resource",
|
||||
assertThat(this.restTemplate.getForObject("https://example.org/resource",
|
||||
String.class)).isEqualTo("Hello World");
|
||||
server.verify();
|
||||
}
|
||||
@@ -135,9 +135,9 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void simplePost() throws Exception {
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/poster.json").build();
|
||||
assertThat(this.restTemplate.postForObject("http://example.org/poster",
|
||||
assertThat(this.restTemplate.postForObject("https://example.org/poster",
|
||||
"greeting", String.class)).isEqualTo("Hello World");
|
||||
server.verify();
|
||||
}
|
||||
@@ -145,14 +145,14 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void postWithHeader() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") // order determined by content...
|
||||
.baseUrl("https://example.org") // order determined by content...
|
||||
.stubs("classpath:/mappings/poster.json",
|
||||
"classpath:/mappings/accept.json")
|
||||
.build();
|
||||
assertThat(
|
||||
this.restTemplate
|
||||
.exchange(
|
||||
RequestEntity.post(new URI("http://example.org/poster"))
|
||||
RequestEntity.post(new URI("https://example.org/poster"))
|
||||
.accept(MediaType.TEXT_PLAIN).build(),
|
||||
String.class)
|
||||
.getBody()).isEqualTo("Accepted World");
|
||||
@@ -161,12 +161,12 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void postWithHeaderContains() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") // order determined by content...
|
||||
.baseUrl("https://example.org") // order determined by content...
|
||||
.stubs("classpath:/mappings/poster.json",
|
||||
"classpath:/mappings/header-contains.json")
|
||||
.build();
|
||||
assertThat(this.restTemplate.exchange(
|
||||
RequestEntity.post(new URI("http://example.org/poster"))
|
||||
RequestEntity.post(new URI("https://example.org/poster"))
|
||||
.accept(MediaType.valueOf("application/v.foo")).build(),
|
||||
String.class).getBody()).isEqualTo("Foo World");
|
||||
}
|
||||
@@ -174,12 +174,12 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void postWithHeaderMatches() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") // order determined by content...
|
||||
.baseUrl("https://example.org") // order determined by content...
|
||||
.stubs("classpath:/mappings/poster.json",
|
||||
"classpath:/mappings/header-matches.json")
|
||||
.build();
|
||||
assertThat(this.restTemplate.exchange(
|
||||
RequestEntity.post(new URI("http://example.org/poster"))
|
||||
RequestEntity.post(new URI("https://example.org/poster"))
|
||||
.accept(MediaType.valueOf("application/v.bar")).build(),
|
||||
String.class).getBody()).isEqualTo("Bar World");
|
||||
}
|
||||
@@ -187,14 +187,14 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void postWithMoreExactHeaderMatch() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") // order determined by content...
|
||||
.baseUrl("https://example.org") // order determined by content...
|
||||
.stubs("classpath:/mappings/header-matches.json",
|
||||
"classpath:/mappings/header-matches-precise.json")
|
||||
.build();
|
||||
assertThat(
|
||||
this.restTemplate
|
||||
.exchange(
|
||||
RequestEntity.post(new URI("http://example.org/poster"))
|
||||
RequestEntity.post(new URI("https://example.org/poster"))
|
||||
.accept(MediaType.valueOf("application/v.bar"))
|
||||
.header("X-Precise", "true").build(),
|
||||
String.class)
|
||||
@@ -204,14 +204,14 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void postWithMoreExactHeaderMatchButOrdered() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") // order matters...
|
||||
.baseUrl("https://example.org") // order matters...
|
||||
.stubs("classpath:/mappings/header-matches.json",
|
||||
"classpath:/mappings/header-matches-precise.json")
|
||||
.ignoreExpectOrder(false).build();
|
||||
assertThat(
|
||||
this.restTemplate
|
||||
.exchange(
|
||||
RequestEntity.post(new URI("http://example.org/poster"))
|
||||
RequestEntity.post(new URI("https://example.org/poster"))
|
||||
.accept(MediaType.valueOf("application/v.bar"))
|
||||
.header("X-Precise", "true").build(),
|
||||
String.class)
|
||||
@@ -222,29 +222,29 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void getWithPriortyOrder() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/resource-with-low-priority.json",
|
||||
"classpath:/mappings/resource-with-high-priority.json")
|
||||
.build();
|
||||
assertThat(this.restTemplate.getForObject("http://example.org/resource",
|
||||
assertThat(this.restTemplate.getForObject("https://example.org/resource",
|
||||
String.class)).isEqualTo("Hello High");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void simpleGetWithAllStubs() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings").build();
|
||||
assertThat(this.restTemplate.getForObject("http://example.org/resource",
|
||||
assertThat(this.restTemplate.getForObject("https://example.org/resource",
|
||||
String.class)).isEqualTo("Hello World");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void simpleGetWithAllStubsInDirectoryWithPeriod() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/io.stubs/mappings").build();
|
||||
assertThat(this.restTemplate.getForObject("http://example.org/resource",
|
||||
assertThat(this.restTemplate.getForObject("https://example.org/resource",
|
||||
String.class)).isEqualTo("Hello World");
|
||||
}
|
||||
|
||||
@@ -252,10 +252,10 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void postWithBodyMatchingJsonPaths() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/body-matches-jsonpath.json").build();
|
||||
|
||||
assertThat(this.restTemplate.postForObject("http://example.org/body",
|
||||
assertThat(this.restTemplate.postForObject("https://example.org/body",
|
||||
new Things(Collections.singletonList(new Thing("RequiredThing"))),
|
||||
String.class)).isEqualTo("Hello Body");
|
||||
}
|
||||
@@ -263,12 +263,12 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void postWithRequestThatHasNonMatchingJsonPaths() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/body-matches-jsonpath.json").build();
|
||||
|
||||
String response;
|
||||
try {
|
||||
response = this.restTemplate.postForObject("http://example.org/body",
|
||||
response = this.restTemplate.postForObject("https://example.org/body",
|
||||
new Things(Collections.singletonList(new Thing("AbsentThing"))),
|
||||
String.class);
|
||||
}
|
||||
@@ -284,11 +284,11 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void postWithBodyMatchingXPath() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/body-matches-xpath.json").build();
|
||||
|
||||
assertThat(this.restTemplate.exchange(RequestEntity
|
||||
.post(URI.create("http://example.org/body"))
|
||||
.post(URI.create("https://example.org/body"))
|
||||
.contentType(MediaType.APPLICATION_XML)
|
||||
.body("<things><thing><name>RequiredThing</name></thing></things>"),
|
||||
String.class).getBody()).isEqualTo("Hello Body");
|
||||
@@ -297,13 +297,13 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void postWithRequestThatHasNonMatchingXPaths() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/body-matches-xpath.json").build();
|
||||
|
||||
ResponseEntity<String> response;
|
||||
try {
|
||||
response = this.restTemplate.exchange(
|
||||
RequestEntity.post(URI.create("http://example.org/body"))
|
||||
RequestEntity.post(URI.create("https://example.org/body"))
|
||||
.contentType(MediaType.APPLICATION_XML).body("<foo/>"),
|
||||
String.class);
|
||||
}
|
||||
@@ -319,10 +319,10 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void postWithBodyMatchingJson() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/body-matches-equaltojson.json").build();
|
||||
|
||||
assertThat(this.restTemplate.postForObject("http://example.org/body",
|
||||
assertThat(this.restTemplate.postForObject("https://example.org/body",
|
||||
new Things(Collections.singletonList(new Thing("RequiredThing"))),
|
||||
String.class)).isEqualTo("Hello Body");
|
||||
}
|
||||
@@ -330,12 +330,12 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void postWithRequestThatHasNonMatchingJson() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/body-matches-equaltojson.json").build();
|
||||
|
||||
String response;
|
||||
try {
|
||||
response = this.restTemplate.postForObject("http://example.org/body",
|
||||
response = this.restTemplate.postForObject("https://example.org/body",
|
||||
new Things(Collections.singletonList(new Thing("AbsentThing"))),
|
||||
String.class);
|
||||
}
|
||||
@@ -351,11 +351,11 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void postWithBodyMatchingXml() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/body-matches-equaltoxml.json").build();
|
||||
|
||||
assertThat(this.restTemplate.exchange(RequestEntity
|
||||
.post(URI.create("http://example.org/body"))
|
||||
.post(URI.create("https://example.org/body"))
|
||||
.contentType(MediaType.APPLICATION_XML)
|
||||
.body("<things><thing><name>RequiredThing</name></thing></things>"),
|
||||
String.class).getBody()).isEqualTo("Hello Body");
|
||||
@@ -364,13 +364,13 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void postWithRequestThatHasNonMatchingXml() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/body-matches-equaltoxml.json").build();
|
||||
|
||||
ResponseEntity<String> response;
|
||||
try {
|
||||
response = this.restTemplate.exchange(RequestEntity
|
||||
.post(URI.create("http://example.org/body"))
|
||||
.post(URI.create("https://example.org/body"))
|
||||
.contentType(MediaType.APPLICATION_XML)
|
||||
.body("<things><thing><name>AbsentThing</name></thing></things>"),
|
||||
String.class);
|
||||
@@ -387,11 +387,11 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void postWithBodyMatchingRegex() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/body-matches-regex.json").build();
|
||||
|
||||
assertThat(this.restTemplate.exchange(RequestEntity
|
||||
.post(URI.create("http://example.org/body"))
|
||||
.post(URI.create("https://example.org/body"))
|
||||
.contentType(MediaType.APPLICATION_XML)
|
||||
.body("<things><thing><name>RequiredThing</name></thing></things>"),
|
||||
String.class).getBody()).isEqualTo("Hello Body");
|
||||
@@ -400,13 +400,13 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void postWithRequestThatHasNonMatchingRegex() throws Exception {
|
||||
WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/body-matches-regex.json").build();
|
||||
|
||||
ResponseEntity<String> response;
|
||||
try {
|
||||
response = this.restTemplate.exchange(RequestEntity
|
||||
.post(URI.create("http://example.org/body"))
|
||||
.post(URI.create("https://example.org/body"))
|
||||
.contentType(MediaType.APPLICATION_XML)
|
||||
.body("<things><thing><name>AbsentThing</name></thing></things>"),
|
||||
String.class);
|
||||
@@ -423,10 +423,10 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void getWithUrlPathMatching() throws Exception {
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/url-path-pattern.json").build();
|
||||
assertThat(this.restTemplate
|
||||
.getForObject("http://example.org/123/url-path-pattern/", String.class))
|
||||
.getForObject("https://example.org/123/url-path-pattern/", String.class))
|
||||
.isEqualTo("Hello Url Path Matcher");
|
||||
server.verify();
|
||||
}
|
||||
@@ -434,10 +434,10 @@ public class WiremockMockServerApplicationTests {
|
||||
@Test
|
||||
public void getWithUrlMatching() throws Exception {
|
||||
MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate) //
|
||||
.baseUrl("http://example.org") //
|
||||
.baseUrl("https://example.org") //
|
||||
.stubs("classpath:/mappings/url-matches.json").build();
|
||||
assertThat(this.restTemplate
|
||||
.getForObject("http://example.org/123/hello-url-matcher/", String.class))
|
||||
.getForObject("https://example.org/123/hello-url-matcher/", String.class))
|
||||
.isEqualTo("Hello Url Matcher");
|
||||
server.verify();
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ class Service {
|
||||
|
||||
private static final Log log = LogFactory.getLog(Service.class);
|
||||
|
||||
@Value("${app.baseUrl:http://example.org}")
|
||||
@Value("${app.baseUrl:https://example.org}")
|
||||
String base;
|
||||
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@@ -95,7 +95,7 @@ class AmqpMessagingApplicationSpec extends Specification {
|
||||
Contract.make {
|
||||
description("""
|
||||
Represents scenario 2 from documentation:
|
||||
http://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html#_publisher_side_test_generation
|
||||
https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html#_publisher_side_test_generation
|
||||
|
||||
"The input message triggers an output message."
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud.contract.verifier.stubs.amqp</groupId>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud.contract.verifier.stubs</groupId>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud.contract.verifier.stubs</groupId>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud.contract.verifier.stubs</groupId>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud.contract.verifier.stubs</groupId>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud.contract.verifier.stubs</groupId>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud.contract.verifier.stubs</groupId>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud.contract.verifier.stubs</groupId>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud.contract.verifier.stubs</groupId>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud.contract.verifier.stubs</groupId>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<project
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud.contract.verifier.stubs</groupId>
|
||||
|
||||
Reference in New Issue
Block a user