Moved JacksonObjectMapperFactoryBean from web.context.support to http.converter.json

Issue: SPR-9125
This commit is contained in:
Juergen Hoeller
2012-09-24 11:39:09 +02:00
parent dc4e0683ae
commit 53ae345a88
2 changed files with 40 additions and 60 deletions

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.web.context.support;
package org.springframework.http.converter.json;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -33,10 +33,9 @@ import org.codehaus.jackson.map.introspect.NopAnnotationIntrospector;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.FatalBeanException;
import org.springframework.http.converter.json.JacksonObjectMapperFactoryBean;
/**
* Test cases for {@link JacksonObjectMapperFactoryBean} class.
*
* @author <a href="mailto:dmitry.katsubo@gmail.com">Dmitry Katsubo</a>
*/
public class JacksonObjectMapperFactoryBeanTests {
@@ -50,24 +49,13 @@ public class JacksonObjectMapperFactoryBeanTests {
factory = new JacksonObjectMapperFactoryBean();
}
@Test(expected=FatalBeanException.class)
public void testSetFeaturesToEnableNull() throws Exception {
factory.setFeaturesToEnable(null);
factory.setFeaturesToEnable(new Object[0]);
}
@Test(expected=FatalBeanException.class)
public void testSetFeaturesToDisableNull() {
factory.setFeaturesToDisable(null);
}
@Test
public void testSetFeaturesToEnableEmpty() {
factory.setFeaturesToEnable(new Object[0]);
factory.setFeaturesToDisable(new Object[0]);
}
@Test(expected = FatalBeanException.class)
@Test(expected = IllegalArgumentException.class)
public void testUnknownFeature() {
factory.setFeaturesToEnable(new Object[] { Boolean.TRUE });
factory.afterPropertiesSet();
@@ -168,4 +156,5 @@ public class JacksonObjectMapperFactoryBeanTests {
assertFalse(jsonFactory.isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE));
assertFalse(jsonFactory.isEnabled(JsonGenerator.Feature.QUOTE_FIELD_NAMES));
}
}