Spring MVC Test now parses application/x-www-form-urlencoded request
content and populates request parameters from it.
This can be useful when running client-side tests against a MockMvc
via MockMvcClientHttpRequestFactory.
Issue: SPR-13733
Prior to this commit, Spring MVC Test only supported HTTP methods GET,
POST, HEAD, OPTIONS, PUT, PATCH, DELETE, TRACE and multipart file
upload. This change adds generic methods to MockMvcRequestBuilders in
order to allow testing of arbitrary HTTP methods in a Spring MVC
application.
Issue: SPR-13719
The inner MimeTypeResolver class is no longer necessary in the
MockServletContext since the Java Activation Framework (JAF) is a
standard part of Java SE since Java 6.
Prior to this commit, HtmlUnitRequestBuilder stored empty query
parameters declared without an equals sign as null (i.e., query
parameters such as 'error' in 'http://example.com/login?error').
This commit addresses this issue by ensuring that
HtmlUnitRequestBuilder treats all empty query parameter values as empty
strings. Consequently, query strings such as '?error' and '?error=' now
both result in 'error' being stored as an empty string.
Issue: SPR-13524
Prior to this commit, HtmlUnitRequestBuilder would incorrectly attempt
to decode null values for query parameters (i.e., query parameters such
as 'error' in 'http://example.com/login?error') which resulted in a
NullPointerException since URLDecoder.decode() does not support null
values.
This commit fixes this issue by ensuring that HtmlUnitRequestBuilder
only attempts to decode non-null query parameter values.
Issue: SPR-13524
SpringJUnit4ClassRunner, SpringClassRule, and SpringMethodRule now
throw an IllegalStateException with a meaningful message if JUnit 4.9
is not present in the classpath (specifically if
org.junit.runners.model.MultipleFailureException cannot be loaded).
Issue: SPR-13521
This commit migrates all remaining tests from JUnit 3 to JUnit 4, with
the exception of Spring's legacy JUnit 3.8 based testing framework that
is still in use in the spring-orm module.
Issue: SPR-13514
The MockHttpServletRequestBuilder now uses java.net.URI internally
rather than UriComponents.
This means that for the MockMvcRequestBuilders method variants that
accept a java.net.URI we can use it as is. The difference is almost
none but it does mean that you can create a URI with double slashes
(for testing purposes) and have it remain that way.
Issue: SPR-13435
This commit introduces support for attribute overrides for
@ResponseStatus when @ResponseStatus is used as a meta-annotation on
a custom composed annotation.
Specifically, this commit migrates all code that looks up
@ResponseStatus from using AnnotationUtils.findAnnotation() to using
AnnotatedElementUtils.findMergedAnnotation().
Issue: SPR-13441