Polish "Use HTTPS for external links where possible"
See gh-610
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -133,7 +133,7 @@ public class UriModifyingOperationPreprocessorTests {
|
||||
this.preprocessor.host("api.example.com");
|
||||
OperationRequest processed = this.preprocessor
|
||||
.preprocess(createRequestWithContent(
|
||||
"The uri 'http://localhost:12345' should be used"));
|
||||
"The uri 'https://localhost:12345' should be used"));
|
||||
assertThat(new String(processed.getContent()),
|
||||
is(equalTo("The uri 'https://api.example.com:12345' should be used")));
|
||||
}
|
||||
@@ -213,7 +213,7 @@ public class UriModifyingOperationPreprocessorTests {
|
||||
this.preprocessor.host("api.example.com");
|
||||
OperationResponse processed = this.preprocessor
|
||||
.preprocess(createResponseWithContent(
|
||||
"The uri 'http://localhost:12345' should be used"));
|
||||
"The uri 'https://localhost:12345' should be used"));
|
||||
assertThat(new String(processed.getContent()),
|
||||
is(equalTo("The uri 'https://api.example.com:12345' should be used")));
|
||||
}
|
||||
@@ -281,7 +281,7 @@ public class UriModifyingOperationPreprocessorTests {
|
||||
@Test
|
||||
public void urisInRequestHeadersCanBeModified() {
|
||||
OperationRequest processed = this.preprocessor.host("api.example.com")
|
||||
.preprocess(createRequestWithHeader("Foo", "http://locahost:12345"));
|
||||
.preprocess(createRequestWithHeader("Foo", "https://locahost:12345"));
|
||||
assertThat(processed.getHeaders().getFirst("Foo"),
|
||||
is(equalTo("https://api.example.com:12345")));
|
||||
assertThat(processed.getHeaders().getFirst("Host"),
|
||||
@@ -291,7 +291,7 @@ public class UriModifyingOperationPreprocessorTests {
|
||||
@Test
|
||||
public void urisInResponseHeadersCanBeModified() {
|
||||
OperationResponse processed = this.preprocessor.host("api.example.com")
|
||||
.preprocess(createResponseWithHeader("Foo", "http://locahost:12345"));
|
||||
.preprocess(createResponseWithHeader("Foo", "https://locahost:12345"));
|
||||
assertThat(processed.getHeaders().getFirst("Foo"),
|
||||
is(equalTo("https://api.example.com:12345")));
|
||||
}
|
||||
@@ -299,7 +299,7 @@ public class UriModifyingOperationPreprocessorTests {
|
||||
@Test
|
||||
public void urisInRequestPartHeadersCanBeModified() {
|
||||
OperationRequest processed = this.preprocessor.host("api.example.com").preprocess(
|
||||
createRequestWithPartWithHeader("Foo", "http://locahost:12345"));
|
||||
createRequestWithPartWithHeader("Foo", "https://locahost:12345"));
|
||||
assertThat(processed.getParts().iterator().next().getHeaders().getFirst("Foo"),
|
||||
is(equalTo("https://api.example.com:12345")));
|
||||
}
|
||||
@@ -308,7 +308,7 @@ public class UriModifyingOperationPreprocessorTests {
|
||||
public void urisInRequestPartContentCanBeModified() {
|
||||
OperationRequest processed = this.preprocessor.host("api.example.com")
|
||||
.preprocess(createRequestWithPartWithContent(
|
||||
"The uri 'http://localhost:12345' should be used"));
|
||||
"The uri 'https://localhost:12345' should be used"));
|
||||
assertThat(new String(processed.getParts().iterator().next().getContent()),
|
||||
is(equalTo("The uri 'https://api.example.com:12345' should be used")));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user