Merge branch 'master' into 2.0.x

This commit is contained in:
Marcin Grzejszczak
2017-11-13 10:18:37 +01:00
7 changed files with 10 additions and 7 deletions

View File

@@ -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>

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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());

View File

@@ -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("/");