Clean up warnings in spring-web
This commit is contained in:
@@ -195,7 +195,6 @@ public class HttpComponentsClientHttpRequestFactory implements ClientHttpRequest
|
||||
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) throws IOException {
|
||||
HttpClient client = getHttpClient();
|
||||
Assert.state(client != null, "Synchronous execution requires an HttpClient to be set");
|
||||
|
||||
@@ -27,7 +27,6 @@ import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import javax.mail.internet.MimeUtility;
|
||||
|
||||
import org.springframework.core.io.Resource;
|
||||
@@ -99,8 +98,6 @@ public class FormHttpMessageConverter implements HttpMessageConverter<MultiValue
|
||||
|
||||
private List<HttpMessageConverter<?>> partConverters = new ArrayList<HttpMessageConverter<?>>();
|
||||
|
||||
private final Random random = new Random();
|
||||
|
||||
|
||||
public FormHttpMessageConverter() {
|
||||
this.supportedMediaTypes.add(MediaType.APPLICATION_FORM_URLENCODED);
|
||||
|
||||
@@ -465,6 +465,7 @@ public class Jackson2ObjectMapperBuilder {
|
||||
* @see #modulesToInstall(Module...)
|
||||
* @see com.fasterxml.jackson.databind.Module
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Jackson2ObjectMapperBuilder modulesToInstall(Class<? extends Module>... modules) {
|
||||
this.moduleClasses = modules;
|
||||
this.findWellKnownModules = true;
|
||||
@@ -712,7 +713,6 @@ public class Jackson2ObjectMapperBuilder {
|
||||
* Obtain a {@link Jackson2ObjectMapperBuilder} instance in order to
|
||||
* build an {@link XmlMapper} instance.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Jackson2ObjectMapperBuilder xml() {
|
||||
return new Jackson2ObjectMapperBuilder().createXmlMapper(true);
|
||||
}
|
||||
|
||||
@@ -348,6 +348,7 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean<ObjectMapper
|
||||
* @since 4.0.1
|
||||
* @see com.fasterxml.jackson.databind.Module
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setModulesToInstall(Class<? extends Module>... modules) {
|
||||
this.builder.modulesToInstall(modules);
|
||||
}
|
||||
@@ -391,7 +392,6 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean<ObjectMapper
|
||||
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void afterPropertiesSet() {
|
||||
if (this.objectMapper != null) {
|
||||
this.builder.configure(this.objectMapper);
|
||||
|
||||
@@ -34,7 +34,6 @@ import org.springframework.http.server.ServerHttpRequest;
|
||||
import org.springframework.http.server.ServerHttpResponse;
|
||||
import org.springframework.http.server.ServletServerHttpRequest;
|
||||
import org.springframework.http.server.ServletServerHttpResponse;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
/**
|
||||
|
||||
@@ -872,7 +872,6 @@ final class HierarchicalUriComponents extends UriComponents {
|
||||
@Override
|
||||
public void copyToUriComponentsBuilder(UriComponentsBuilder builder) {
|
||||
}
|
||||
@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return (this == obj);
|
||||
|
||||
@@ -33,9 +33,6 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.http.HttpRequest;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -135,14 +132,12 @@ public abstract class WebUtils {
|
||||
/** Key for the mutex session attribute */
|
||||
public static final String SESSION_MUTEX_ATTRIBUTE = WebUtils.class.getName() + ".MUTEX";
|
||||
|
||||
private static final Log logger = LogFactory.getLog(WebUtils.class);
|
||||
|
||||
|
||||
/**
|
||||
* Set a system property to the web application root directory.
|
||||
* The key of the system property can be defined with the "webAppRootKey"
|
||||
* context-param in {@code web.xml}. Default is "webapp.root".
|
||||
* <p>Can be used for tools that support substition with {@code System.getProperty}
|
||||
* <p>Can be used for tools that support substitution with {@code System.getProperty}
|
||||
* values, like log4j's "${key}" syntax within log file locations.
|
||||
* @param servletContext the servlet context of the web application
|
||||
* @throws IllegalStateException if the system property is already set,
|
||||
|
||||
@@ -28,8 +28,6 @@ import java.util.concurrent.TimeUnit;
|
||||
*/
|
||||
public class CacheControlTests {
|
||||
|
||||
private static final String CACHE_CONTROL_HEADER = "Cache-Control";
|
||||
|
||||
@Test
|
||||
public void emptyCacheControl() throws Exception {
|
||||
CacheControl cc = CacheControl.empty();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -20,6 +20,7 @@ import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
@@ -172,6 +173,7 @@ public class GsonFactoryBeanTests {
|
||||
|
||||
private String name;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
@@ -186,6 +188,7 @@ public class GsonFactoryBeanTests {
|
||||
|
||||
private Date date;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public Date getDate() {
|
||||
return this.date;
|
||||
}
|
||||
@@ -200,6 +203,7 @@ public class GsonFactoryBeanTests {
|
||||
|
||||
private byte[] bytes;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public byte[] getBytes() {
|
||||
return this.bytes;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ import com.fasterxml.jackson.databind.ser.std.ClassSerializer;
|
||||
import com.fasterxml.jackson.databind.ser.std.NumberSerializer;
|
||||
import com.fasterxml.jackson.databind.type.SimpleType;
|
||||
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.DateTimeZone;
|
||||
import org.junit.Test;
|
||||
@@ -143,26 +144,25 @@ public class Jackson2ObjectMapperBuilderTests {
|
||||
@Test
|
||||
public void setNotNullSerializationInclusion() {
|
||||
ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().build();
|
||||
assertTrue(objectMapper.getSerializationConfig().getSerializationInclusion() ==
|
||||
JsonInclude.Include.ALWAYS);
|
||||
assertSame(JsonInclude.Include.ALWAYS, objectMapper.getSerializationConfig().getSerializationInclusion());
|
||||
objectMapper = Jackson2ObjectMapperBuilder.json().serializationInclusion(JsonInclude.Include.NON_NULL).build();
|
||||
assertTrue(objectMapper.getSerializationConfig().getSerializationInclusion() == JsonInclude.Include.NON_NULL);
|
||||
assertSame(JsonInclude.Include.NON_NULL, objectMapper.getSerializationConfig().getSerializationInclusion());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setNotDefaultSerializationInclusion() {
|
||||
ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().build();
|
||||
assertTrue(objectMapper.getSerializationConfig().getSerializationInclusion() == JsonInclude.Include.ALWAYS);
|
||||
assertSame(JsonInclude.Include.ALWAYS, objectMapper.getSerializationConfig().getSerializationInclusion());
|
||||
objectMapper = Jackson2ObjectMapperBuilder.json().serializationInclusion(JsonInclude.Include.NON_DEFAULT).build();
|
||||
assertTrue(objectMapper.getSerializationConfig().getSerializationInclusion() == JsonInclude.Include.NON_DEFAULT);
|
||||
assertSame(JsonInclude.Include.NON_DEFAULT, objectMapper.getSerializationConfig().getSerializationInclusion());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setNotEmptySerializationInclusion() {
|
||||
ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().build();
|
||||
assertTrue(objectMapper.getSerializationConfig().getSerializationInclusion() == JsonInclude.Include.ALWAYS);
|
||||
assertSame(JsonInclude.Include.ALWAYS, objectMapper.getSerializationConfig().getSerializationInclusion());
|
||||
objectMapper = Jackson2ObjectMapperBuilder.json().serializationInclusion(JsonInclude.Include.NON_EMPTY).build();
|
||||
assertTrue(objectMapper.getSerializationConfig().getSerializationInclusion() == JsonInclude.Include.NON_EMPTY);
|
||||
assertSame(JsonInclude.Include.NON_EMPTY, objectMapper.getSerializationConfig().getSerializationInclusion());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -213,26 +213,27 @@ public class Jackson2ObjectMapperBuilderTests {
|
||||
|
||||
@Test
|
||||
public void modules() {
|
||||
NumberSerializer serializer1 = new NumberSerializer();
|
||||
NumberSerializer serializer1 = new NumberSerializer(Integer.class);
|
||||
SimpleModule module = new SimpleModule();
|
||||
module.addSerializer(Integer.class, serializer1);
|
||||
ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().modules(module).build();
|
||||
Serializers serializers = getSerializerFactoryConfig(objectMapper).serializers().iterator().next();
|
||||
assertTrue(serializers.findSerializer(null, SimpleType.construct(Integer.class), null) == serializer1);
|
||||
assertSame(serializer1, serializers.findSerializer(null, SimpleType.construct(Integer.class), null));
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void modulesToInstallByClass() {
|
||||
ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().modulesToInstall(CustomIntegerModule.class).build();
|
||||
Serializers serializers = getSerializerFactoryConfig(objectMapper).serializers().iterator().next();
|
||||
assertTrue(serializers.findSerializer(null, SimpleType.construct(Integer.class), null).getClass() == CustomIntegerSerializer.class);
|
||||
assertSame(CustomIntegerSerializer.class, serializers.findSerializer(null, SimpleType.construct(Integer.class), null).getClass());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void modulesToInstallByInstance() {
|
||||
ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().modulesToInstall(new CustomIntegerModule()).build();
|
||||
Serializers serializers = getSerializerFactoryConfig(objectMapper).serializers().iterator().next();
|
||||
assertTrue(serializers.findSerializer(null, SimpleType.construct(Integer.class), null).getClass() == CustomIntegerSerializer.class);
|
||||
assertSame(CustomIntegerSerializer.class, serializers.findSerializer(null, SimpleType.construct(Integer.class), null).getClass());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -257,6 +258,7 @@ public class Jackson2ObjectMapperBuilderTests {
|
||||
}
|
||||
|
||||
@Test // SPR-12634
|
||||
@SuppressWarnings("unchecked")
|
||||
public void customizeDefaultModulesWithModuleClass() throws JsonProcessingException, UnsupportedEncodingException {
|
||||
ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().modulesToInstall(CustomIntegerModule.class).build();
|
||||
DateTime dateTime = new DateTime(1322903730000L, DateTimeZone.UTC);
|
||||
@@ -292,13 +294,13 @@ public class Jackson2ObjectMapperBuilderTests {
|
||||
|
||||
@Test
|
||||
public void serializerByType() {
|
||||
JsonSerializer<Number> serializer = new NumberSerializer();
|
||||
JsonSerializer<Number> serializer = new NumberSerializer(Integer.class);
|
||||
ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json()
|
||||
.modules(new ArrayList<>()) // Disable well-known modules detection
|
||||
.serializerByType(Boolean.class, serializer).build();
|
||||
assertTrue(getSerializerFactoryConfig(objectMapper).hasSerializers());
|
||||
Serializers serializers = getSerializerFactoryConfig(objectMapper).serializers().iterator().next();
|
||||
assertTrue(serializers.findSerializer(null, SimpleType.construct(Boolean.class), null) == serializer);
|
||||
assertSame(serializer, serializers.findSerializer(null, SimpleType.construct(Boolean.class), null));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -309,7 +311,7 @@ public class Jackson2ObjectMapperBuilderTests {
|
||||
.deserializerByType(Date.class, deserializer).build();
|
||||
assertTrue(getDeserializerFactoryConfig(objectMapper).hasDeserializers());
|
||||
Deserializers deserializers = getDeserializerFactoryConfig(objectMapper).deserializers().iterator().next();
|
||||
assertTrue(deserializers.findBeanDeserializer(SimpleType.construct(Date.class), null, null) == deserializer);
|
||||
assertSame(deserializer, deserializers.findBeanDeserializer(SimpleType.construct(Date.class), null, null));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -362,7 +364,7 @@ public class Jackson2ObjectMapperBuilderTests {
|
||||
deserializerMap.put(Date.class, deserializer);
|
||||
|
||||
JsonSerializer<Class<?>> serializer1 = new ClassSerializer();
|
||||
JsonSerializer<Number> serializer2 = new NumberSerializer();
|
||||
JsonSerializer<Number> serializer2 = new NumberSerializer(Integer.class);
|
||||
|
||||
Jackson2ObjectMapperBuilder builder = Jackson2ObjectMapperBuilder.json()
|
||||
.modules(new ArrayList<>()) // Disable well-known modules detection
|
||||
@@ -387,15 +389,15 @@ public class Jackson2ObjectMapperBuilderTests {
|
||||
assertTrue(getDeserializerFactoryConfig(objectMapper).hasDeserializers());
|
||||
|
||||
Serializers serializers = getSerializerFactoryConfig(objectMapper).serializers().iterator().next();
|
||||
assertTrue(serializers.findSerializer(null, SimpleType.construct(Class.class), null) == serializer1);
|
||||
assertTrue(serializers.findSerializer(null, SimpleType.construct(Boolean.class), null) == serializer2);
|
||||
assertSame(serializer1, serializers.findSerializer(null, SimpleType.construct(Class.class), null));
|
||||
assertSame(serializer2, serializers.findSerializer(null, SimpleType.construct(Boolean.class), null));
|
||||
assertNull(serializers.findSerializer(null, SimpleType.construct(Number.class), null));
|
||||
|
||||
Deserializers deserializers = getDeserializerFactoryConfig(objectMapper).deserializers().iterator().next();
|
||||
assertTrue(deserializers.findBeanDeserializer(SimpleType.construct(Date.class), null, null) == deserializer);
|
||||
assertSame(deserializer, deserializers.findBeanDeserializer(SimpleType.construct(Date.class), null, null));
|
||||
|
||||
assertTrue(annotationIntrospector == objectMapper.getSerializationConfig().getAnnotationIntrospector());
|
||||
assertTrue(annotationIntrospector == objectMapper.getDeserializationConfig().getAnnotationIntrospector());
|
||||
assertSame(annotationIntrospector, objectMapper.getSerializationConfig().getAnnotationIntrospector());
|
||||
assertSame(annotationIntrospector, objectMapper.getDeserializationConfig().getAnnotationIntrospector());
|
||||
|
||||
assertTrue(objectMapper.getSerializationConfig().isEnabled(SerializationFeature.FAIL_ON_EMPTY_BEANS));
|
||||
assertTrue(objectMapper.getDeserializationConfig().isEnabled(DeserializationFeature.UNWRAP_ROOT_VALUE));
|
||||
@@ -408,7 +410,7 @@ public class Jackson2ObjectMapperBuilderTests {
|
||||
assertFalse(objectMapper.getDeserializationConfig().isEnabled(MapperFeature.AUTO_DETECT_FIELDS));
|
||||
assertFalse(objectMapper.getFactory().isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE));
|
||||
assertFalse(objectMapper.getFactory().isEnabled(JsonGenerator.Feature.QUOTE_FIELD_NAMES));
|
||||
assertTrue(objectMapper.getSerializationConfig().getSerializationInclusion() == JsonInclude.Include.NON_NULL);
|
||||
assertSame(JsonInclude.Include.NON_NULL, objectMapper.getSerializationConfig().getSerializationInclusion());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -222,7 +222,7 @@ public class Jackson2ObjectMapperFactoryBeanTests {
|
||||
|
||||
@Test
|
||||
public void setModules() {
|
||||
NumberSerializer serializer1 = new NumberSerializer();
|
||||
NumberSerializer serializer1 = new NumberSerializer(Integer.class);
|
||||
SimpleModule module = new SimpleModule();
|
||||
module.addSerializer(Integer.class, serializer1);
|
||||
|
||||
@@ -341,7 +341,7 @@ public class Jackson2ObjectMapperFactoryBeanTests {
|
||||
deserializers.put(Date.class, new DateDeserializer());
|
||||
|
||||
JsonSerializer<Class<?>> serializer1 = new ClassSerializer();
|
||||
JsonSerializer<Number> serializer2 = new NumberSerializer();
|
||||
JsonSerializer<Number> serializer2 = new NumberSerializer(Integer.class);
|
||||
|
||||
factory.setModules(new ArrayList<>()); // Disable well-known modules detection
|
||||
factory.setSerializers(serializer1);
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.ser.FilterProvider;
|
||||
import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
|
||||
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.core.ParameterizedTypeReference;
|
||||
@@ -395,6 +396,7 @@ public class MappingJackson2HttpMessageConverterTests {
|
||||
private interface MyJacksonView1 {};
|
||||
private interface MyJacksonView2 {};
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static class JacksonViewBean {
|
||||
|
||||
@JsonView(MyJacksonView1.class)
|
||||
@@ -431,6 +433,7 @@ public class MappingJackson2HttpMessageConverterTests {
|
||||
}
|
||||
|
||||
@JsonFilter("myJacksonFilter")
|
||||
@SuppressWarnings("unused")
|
||||
private static class JacksonFilteredBean {
|
||||
|
||||
private String property1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -106,13 +106,13 @@ public class SpringHandlerInstantiatorTests {
|
||||
|
||||
@Test
|
||||
public void applicationContextAwaretypeResolverBuilder() throws JsonProcessingException {
|
||||
this.objectMapper.writeValueAsString(new Group("authors"));
|
||||
this.objectMapper.writeValueAsString(new Group());
|
||||
assertTrue(CustomTypeResolverBuilder.isAutowiredFiledInitialized);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void applicationContextAwareTypeIdResolver() throws JsonProcessingException {
|
||||
this.objectMapper.writeValueAsString(new Group("authors"));
|
||||
this.objectMapper.writeValueAsString(new Group());
|
||||
assertTrue(CustomTypeIdResolver.isAutowiredFiledInitialized);
|
||||
}
|
||||
|
||||
@@ -261,15 +261,6 @@ public class SpringHandlerInstantiatorTests {
|
||||
@JsonTypeIdResolver(CustomTypeIdResolver.class)
|
||||
public static class Group {
|
||||
|
||||
private String name;
|
||||
|
||||
public Group(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Group() {
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return Group.class.getName();
|
||||
}
|
||||
|
||||
@@ -45,7 +45,6 @@ import static org.junit.Assert.*;
|
||||
* @author Arjen Poutsma
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class Jaxb2CollectionHttpMessageConverterTests {
|
||||
|
||||
private Jaxb2CollectionHttpMessageConverter<?> converter;
|
||||
|
||||
@@ -53,7 +53,6 @@ import static org.junit.Assert.assertTrue;
|
||||
* @author Sebastien Deleuze
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class Jaxb2RootElementHttpMessageConverterTests {
|
||||
|
||||
private Jaxb2RootElementHttpMessageConverter converter;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -42,6 +42,7 @@ import static org.junit.Assert.*;
|
||||
public class HttpInvokerFactoryBeanIntegrationTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testLoadedConfigClass() {
|
||||
ApplicationContext context = new AnnotationConfigApplicationContext(InvokerAutowiringConfig.class);
|
||||
MyBean myBean = context.getBean("myBean", MyBean.class);
|
||||
@@ -51,6 +52,7 @@ public class HttpInvokerFactoryBeanIntegrationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testNonLoadedConfigClass() {
|
||||
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
context.registerBeanDefinition("config", new RootBeanDefinition(InvokerAutowiringConfig.class.getName()));
|
||||
@@ -62,6 +64,7 @@ public class HttpInvokerFactoryBeanIntegrationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void withConfigurationClassWithPlainFactoryBean() {
|
||||
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
context.register(ConfigWithPlainFactoryBean.class);
|
||||
@@ -133,7 +136,7 @@ public class HttpInvokerFactoryBeanIntegrationTests {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FactoryBean myService() {
|
||||
public HttpInvokerProxyFactoryBean myService() {
|
||||
String name = env.getProperty("testbean.name");
|
||||
HttpInvokerProxyFactoryBean factory = new HttpInvokerProxyFactoryBean();
|
||||
factory.setServiceUrl("/svc/" + name);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -36,6 +36,7 @@ import static org.junit.Assert.*;
|
||||
public class RequestAndSessionScopedBeanTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testPutBeanInRequest() throws Exception {
|
||||
String targetBeanName = "target";
|
||||
|
||||
@@ -75,6 +76,7 @@ public class RequestAndSessionScopedBeanTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void testPutBeanInSession() throws Exception {
|
||||
String targetBeanName = "target";
|
||||
HttpServletRequest request = new MockHttpServletRequest();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -34,6 +34,7 @@ import static org.junit.Assert.*;
|
||||
public class AnnotationConfigWebApplicationContextTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void registerSingleClass() {
|
||||
AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
|
||||
ctx.register(Config.class);
|
||||
@@ -44,6 +45,7 @@ public class AnnotationConfigWebApplicationContextTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void configLocationWithSingleClass() {
|
||||
AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
|
||||
ctx.setConfigLocation(Config.class.getName());
|
||||
@@ -54,6 +56,7 @@ public class AnnotationConfigWebApplicationContextTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void configLocationWithBasePackage() {
|
||||
AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
|
||||
ctx.setConfigLocation("org.springframework.web.context.support");
|
||||
@@ -64,6 +67,7 @@ public class AnnotationConfigWebApplicationContextTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("resource")
|
||||
public void withBeanNameGenerator() {
|
||||
AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
|
||||
ctx.setBeanNameGenerator(new AnnotationBeanNameGenerator() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -51,6 +51,7 @@ public class ExpressionValueMethodArgumentResolverTests {
|
||||
private NativeWebRequest webRequest;
|
||||
|
||||
@Before
|
||||
@SuppressWarnings("resource")
|
||||
public void setUp() throws Exception {
|
||||
GenericWebApplicationContext context = new GenericWebApplicationContext();
|
||||
context.refresh();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -168,7 +168,6 @@ public class ModelFactoryOrderingTests {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static class StraightLineDependencyController extends AbstractController {
|
||||
|
||||
@ModelAttribute
|
||||
@@ -208,7 +207,6 @@ public class ModelFactoryOrderingTests {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static class TreeDependencyController extends AbstractController {
|
||||
|
||||
@ModelAttribute
|
||||
@@ -247,7 +245,6 @@ public class ModelFactoryOrderingTests {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static class InvertedTreeDependencyController extends AbstractController {
|
||||
|
||||
@ModelAttribute
|
||||
@@ -287,7 +284,6 @@ public class ModelFactoryOrderingTests {
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static class UnresolvedDependencyController extends AbstractController {
|
||||
|
||||
@ModelAttribute
|
||||
|
||||
@@ -58,6 +58,7 @@ public class RequestHeaderMethodArgumentResolverTests {
|
||||
|
||||
|
||||
@Before
|
||||
@SuppressWarnings("resource")
|
||||
public void setUp() throws Exception {
|
||||
GenericWebApplicationContext context = new GenericWebApplicationContext();
|
||||
context.refresh();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -57,7 +57,6 @@ public class CompositeUriComponentsContributorTests {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void handleRequest(@RequestParam String p1, String p2, @RequestHeader String h) {
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -111,6 +111,8 @@ public class CommonsMultipartResolverTests {
|
||||
doTestFiles(request);
|
||||
|
||||
doTestBinding(resolver, originalRequest, request);
|
||||
|
||||
wac.close();
|
||||
}
|
||||
|
||||
private void doTestParameters(MultipartHttpServletRequest request) {
|
||||
|
||||
Reference in New Issue
Block a user