This version fixed bugs and improved performance.
New features: "select multiple attributes" and
"Array operations and slicing improved" (a new example
has been added in tests to reflect that).
See https://github.com/jayway/JsonPath/blob/master/README
Issue: SPR-10990
Prior to this commit, one could only match exact URLs in redirectedUrl
and forwardedUrl ResultMatchers. When creating a resource with
a REST service, URLs often contain the id the new resource,
like "/resource/12".
This commit updates those ResultMatchers to support both
exact matches and AntPath matches, using new methods.
The former URL then can be tested against "/resource/*" in MVC tests.
Issue: SPR-10789
Prior to this commit, one could not test for the absence of
a specific HTTP header in a response.
Using header("X-Custom-Header", Matchers.nullValue()) would not
work because it tests for an empty value of an existing header.
This commit adds a doesNotExist method on the
HeaderResultMatcher.
Issue: SPR-10771
MockFilterChain should not be re-used across requests. This is not an
issue unless tests are executed concurrently. This change ensures the
MockFilterChain is re-created for each request in MockMvc.
Issue: SPR-10838
Also remove Servlet 3 bridge classes no longer needed since Spring
Framework 4 compiles with the Servlet 3 API. That means applications
may need to run tests with the Servlet 3 API jar although
technically they don't have to run with that in production.
Prior to this commit, the longValue() in HeaderResultMatchers added the
expected response header name to generated assertion failure messages;
however, both string() methods did not. This made it more difficult to
analyze the cause of failed tests.
Furthermore, while investigating a solution for this issue it became
apparent that longValue() throws a NullPointerException if the response
does not contain the specified header.
This commit addresses these issues as follows:
- All methods in HeaderResultMatchers now include the response header
name in generated assertion failure messages.
- HeaderResultMatchers.longValue() now avoids NullPointerExceptions by
explicitly asserting that the response contains the specified header.
- The unit tests in HeaderAssertionTests have been expanded to test
most foreseeable use cases.
Issue: SPR-10659
Driven by the need for implementing Bean Validation 1.1's "releaseInstance" method in SpringConstraintValidatorFactory, as a direct counterpart to the use of AutowireCapableBeanFactory's "createBean(Class)" in "getInstance".
Issue: SPR-8199
Changed upper bound of generic parameter for DefaultMockMvcBuilder from
MockMvcBuilder to DefaultMockMvcBuilder to allow for ongoing method
chaining in the fluent API style.
Issue: SPR-10277
An expectation such as content().contentType(MediaType.TEXT_PLAIN)
fails if the actual media type contains a charset or another parameter.
A new method allows comparing the media type and subtype only via
content().contentTypeCompatibleWith(MediaType.TEXT_PLAIN).
Issue: SPR-10165
- Support external Javadoc links using Gradle's javadoc.options.links
- Fix all other Javadoc warnings, such as typos, references to
non-existent (or no longer existent) types and members, etc,
including changes related to the Quartz 2.0 upgrade (SPR-8275) and
adding the HTTP PATCH method (SPR-7985).
- Suppress all output for project-level `javadoc` tasks in order to
hide false-negative warnings about cross-module @see and @link
references (e.g. spring-core having a @see reference to spring-web).
Use the `--info` (-i) flag to gradle at any time to see project-level
javadoc warnings without running the entire `api` task. e.g.
`gradle :spring-core:javadoc -i`
- Favor root project level `api` task for detection of legitimate
Javadoc warnings. There are now zero Javadoc warnings across the
entirety of spring-framework. Goal: keep it that way.
- Remove all @link and @see references to types and members that exist
only in Servlet <= 2.5 and Hibernate <= 4.0, favoring 3.0+ and 4.0+
respectively. This is necessary because only one version of each of
these dependencies can be present on the global `api` javadoc task's
classpath. To that end, the `api` task classpath has now been
customized to ensure that the Servlet 3 API and Hibernate Core 4 jars
have precedence.
- SPR-8896 replaced our dependency on aspectjrt with a dependency on
aspectjweaver, which is fine from a POM point of view, but causes
a spurious warning to be emitted from the ant iajc task that it
"cannot find aspectjrt on the classpath" - even though aspectjweaver
is perfectly sufficient. In the name of keeping the console quiet, a
new `rt` configuration has been added, and aspectjrt added as a
dependency to it. In turn, configurations.rt.asPath is appended to
the iajc classpath during both compileJava and compileTestJava for
spring-aspects.
Issue: SPR-10078, SPR-8275, SPR-7985, SPR-8896
Update tiles.xml files used with tests to reference tiles-config_3_0
instead of tiles-config_2_1 DTD.
Prior to this commit tiles based tests would fail when building
offline or behind a proxy server.
Refactor the existing merge-artifacts script to a full Gradle plugin.
The new plugin uses a 'merge' extension in favor of Gradle 'ext'
configuration and can be applied to all projects in a multi-module
build.
Any project that defines a 'merge.into' project will now implicitly
receive a dependency to that project. Furthermore other projects
with a dependency on 'merge.into' will receive a direct project
link within the IDE. For example: 'spring-webmvc-tiles3'
is merged into 'spring-webmvc' and 'spring-test-mvc' depends
on 'spring-webmvc'. Within the IDE 'spring-test-mvc' will show
dependencies to both 'spring-webmvc' and 'spring-webmvc-tiles'.
Issue: SPR-10042
When Spr9799XmlConfigTests and Spr9799AnnotationConfigTests were
created, there were issues with the classpath related to slf4j
dependencies that made it impossible for these classes to reside in the
spring-test module. Consequently, these tests were added to the
spring-test-mvc module. However, the issues with slf4j have since been
resolved in the Gradle build, and this commit therefore moves these test
classes to the spring-test module where they belong.
Issue: SPR-9799
Prevously the FrameworkServlet created a new ServletRequestAttributes
instance for every request, unless the RequestContextHolder already
contained an instance whose type is not ServletRequestAttributes.
The main intent was that if RequestContextHolder contains a
PortletRequestAttributes, it should be left in place.
This change does an "instanceof" check against the request in
RequestContextHolder instead of an "equals" check on the type.
It still leaves PortletRequestAttributes in place but also allows
the previous request to be any sub-class of ServletRequestAttributes.
Issue: SPR-10025
- Deleted unused imports.
- Switched from junit.framework.Assert to org.junit.Assert, since the
former is deprecated as of JUnit 4.11.
- Suppressed warnings for continued deprecated usage of
junit.framework.Assert.