Fix null parameterName issue in content negotiation

After this change ParameterContentNegotiationStrategy no longer allows
a null parameter name, ContentNegotiationManagerFactoryBean also
requires it.

Issue: SPR-10139
This commit is contained in:
Rossen Stoyanchev
2013-01-03 11:15:36 -05:00
parent 0b2c305072
commit 42cdb200ed
3 changed files with 5 additions and 4 deletions

View File

@@ -88,7 +88,6 @@ public class ContentNegotiationManagerFactoryBeanTests {
@Test
public void favorParameter() throws Exception {
this.factoryBean.setFavorParameter(true);
this.factoryBean.setParameterName("f");
Properties mediaTypes = new Properties();
mediaTypes.put("json", MediaType.APPLICATION_JSON_VALUE);
@@ -98,7 +97,7 @@ public class ContentNegotiationManagerFactoryBeanTests {
ContentNegotiationManager manager = this.factoryBean.getObject();
this.servletRequest.setRequestURI("/flower");
this.servletRequest.addParameter("f", "json");
this.servletRequest.addParameter("format", "json");
assertEquals(Arrays.asList(MediaType.APPLICATION_JSON), manager.resolveMediaTypes(this.webRequest));
}