Merge branch 'master' into 2.0.x
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<name>spring-cloud-contract-dependencies</name>
|
||||
<description>Spring Cloud Contract Dependencies</description>
|
||||
<properties>
|
||||
<wiremock.version>2.10.0</wiremock.version>
|
||||
<wiremock.version>2.11.0</wiremock.version>
|
||||
<jsonassert.version>0.4.10</jsonassert.version>
|
||||
<aether.version>1.0.2.v20150114</aether.version>
|
||||
</properties>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
wiremockVersion=2.10.0
|
||||
wiremockVersion=2.11.0
|
||||
jsonAssertVersion=0.4.10
|
||||
verifierVersion=2.0.0.BUILD-SNAPSHOT
|
||||
|
||||
|
||||
@@ -13,6 +13,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
wiremockVersion=2.10.0
|
||||
wiremockVersion=2.11.0
|
||||
jsonAssertVersion=0.4.10
|
||||
verifierVersion=2.0.0.BUILD-SNAPSHOT
|
||||
|
||||
@@ -13,6 +13,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
wiremockVersion=2.10.0
|
||||
wiremockVersion=2.11.0
|
||||
jsonAssertVersion=0.4.10
|
||||
verifierVersion=2.0.0.BUILD-SNAPSHOT
|
||||
@@ -13,7 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
wiremockVersion=2.10.0
|
||||
wiremockVersion=2.11.0
|
||||
jsonAssertVersion=0.4.10
|
||||
verifierVersion=2.0.0.BUILD-SNAPSHOT
|
||||
|
||||
|
||||
@@ -73,9 +73,10 @@ public class ContractDslSnippet extends TemplatedSnippet {
|
||||
model.put("response_status", response.getStatus().value());
|
||||
model.put("response_body_present", response.getContent().length > 0);
|
||||
model.put("response_body", response.getContentAsString());
|
||||
HttpHeaders headers = response.getHeaders();
|
||||
Map<String, String> headers = response.getHeaders().toSingleValueMap();
|
||||
filterHeaders(headers);
|
||||
model.put("response_headers_present", !headers.isEmpty());
|
||||
model.put("response_headers", headers.toSingleValueMap().entrySet());
|
||||
model.put("response_headers", headers.entrySet());
|
||||
@SuppressWarnings("unchecked") Set<String> jsonPaths = (Set<String>) operation.getAttributes()
|
||||
.get("contract.jsonPaths");
|
||||
model.put("response_json_paths_present", jsonPaths != null && !jsonPaths.isEmpty());
|
||||
|
||||
@@ -84,6 +84,8 @@ public class ContractDslSnippetTests {
|
||||
then(parsedContract.getRequest().getHeaders().getEntries()).isNotNull();
|
||||
then(headerNames(parsedContract.getRequest().getHeaders().getEntries())).doesNotContain
|
||||
(HttpHeaders.HOST, HttpHeaders.CONTENT_LENGTH);
|
||||
then(headerNames(parsedContract.getResponse().getHeaders().getEntries())).doesNotContain
|
||||
(HttpHeaders.HOST, HttpHeaders.CONTENT_LENGTH);
|
||||
then(parsedContract.getRequest().getMethod().getClientValue()).isNotNull();
|
||||
then(parsedContract.getRequest().getUrl().getClientValue()).isNotNull();
|
||||
then(parsedContract.getRequest().getUrl().getClientValue().toString()).startsWith("/");
|
||||
|
||||
Reference in New Issue
Block a user