Compile and test against Spring Framework 4.3.6.RELEASE

This commit upgrade to Spring Framework 4.3.6.RELEASE. A side-effect
of this change is that the Content-Type header is now always the first
header when building a request with MockMvc. One test has been updated
to reflect this change in ordering.

Closes gh-342
This commit is contained in:
Andy Wilkinson
2017-01-25 19:57:29 +00:00
parent e2041333a6
commit 677a23647f
2 changed files with 22 additions and 18 deletions

View File

@@ -34,7 +34,7 @@ sonarqube {
}
ext {
springVersion = '4.3.1.RELEASE'
springVersion = '4.3.6.RELEASE'
javadocLinks = [
'http://docs.oracle.com/javase/8/docs/api/',
"http://docs.spring.io/spring-framework/docs/$springVersion/javadoc-api/",

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 the original author or authors.
* Copyright 2014-2017 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.
@@ -401,26 +401,30 @@ public class MockMvcRestDocumentationIntegrationTests {
assertThat(
new File("build/generated-snippets/original-request/http-request.adoc"),
is(snippet(asciidoctor())
.withContents(
httpRequest(asciidoctor(), RequestMethod.GET, "/")
.header("a", "alpha").header("b", "bravo")
.header("Content-Type", "application/json")
.header("Accept",
MediaType.APPLICATION_JSON_VALUE)
is(snippet(
asciidoctor())
.withContents(
httpRequest(asciidoctor(), RequestMethod.GET, "/")
.header("Content-Type",
"application/json")
.header("a", "alpha").header("b", "bravo")
.header("Accept",
MediaType.APPLICATION_JSON_VALUE)
.header("Host", "localhost:8080")
.header("Content-Length", "13")
.content("{\"a\":\"alpha\"}"))));
String prettyPrinted = String.format("{%n \"a\" : \"<<beta>>\"%n}");
assertThat(
new File(
"build/generated-snippets/preprocessed-request/http-request.adoc"),
is(snippet(asciidoctor())
.withContents(httpRequest(asciidoctor(), RequestMethod.GET, "/")
.header("b", "bravo")
.header("Content-Type", "application/json")
.header("Accept", MediaType.APPLICATION_JSON_VALUE)
.content(prettyPrinted))));
assertThat(new File(
"build/generated-snippets/preprocessed-request/http-request.adoc"), is(
snippet(asciidoctor())
.withContents(
httpRequest(asciidoctor(), RequestMethod.GET, "/")
.header("Content-Type",
"application/json")
.header("b", "bravo")
.header("Accept",
MediaType.APPLICATION_JSON_VALUE)
.content(prettyPrinted))));
}
@Test