#469 - Removed support for AnnotationMethodHandlerAdapter.
Added a Spring 5 specific build profile and removed the references to AnnotationMethodHandlerAdapter which already had been deprecated in the latest Spring 3 in favor of RequestMappingHandlerAdapter. Updated Spring build profiles in general.
This commit is contained in:
@@ -6,7 +6,8 @@ env:
|
||||
- PROFILE=non-existant
|
||||
- PROFILE=spring42
|
||||
- PROFILE=spring43
|
||||
- PROFILE=spring42-next
|
||||
- PROFILE=spring43-next
|
||||
- PROFILE=spring5-next
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.m2
|
||||
|
||||
26
pom.xml
26
pom.xml
@@ -75,7 +75,7 @@
|
||||
<profile>
|
||||
<id>spring42</id>
|
||||
<properties>
|
||||
<spring.version>4.2.6.RELEASE</spring.version>
|
||||
<spring.version>4.2.7.RELEASE</spring.version>
|
||||
<jackson.version>2.6.5</jackson.version>
|
||||
</properties>
|
||||
</profile>
|
||||
@@ -83,21 +83,29 @@
|
||||
<profile>
|
||||
<id>spring43</id>
|
||||
<properties>
|
||||
<spring.version>4.3.0.RC1</spring.version>
|
||||
<spring.version>4.3.1.RELEASE</spring.version>
|
||||
<jackson.version>2.7.4</jackson.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-libs-milestone</id>
|
||||
<url>http://repo.spring.io/libs-milestone</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spring43-next</id>
|
||||
<properties>
|
||||
<spring.version>4.3.0.BUILD-SNAPSHOT</spring.version>
|
||||
<spring.version>4.3.2.BUILD-SNAPSHOT</spring.version>
|
||||
<jackson.version>2.7.4</jackson.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-libs-snapshot</id>
|
||||
<url>http://repo.spring.io/libs-snapshot</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>spring5-next</id>
|
||||
<properties>
|
||||
<spring.version>5.0.0.BUILD-SNAPSHOT</spring.version>
|
||||
<jackson.version>2.7.4</jackson.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 the original author or authors.
|
||||
* Copyright 2013-2016 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.
|
||||
@@ -64,7 +64,6 @@ import org.springframework.plugin.core.support.PluginRegistryFactoryBean;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
|
||||
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
@@ -77,7 +76,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
class HypermediaSupportBeanDefinitionRegistrar implements ImportBeanDefinitionRegistrar {
|
||||
|
||||
private static final String DELEGATING_REL_PROVIDER_BEAN_NAME = "_relProvider";
|
||||
@@ -253,13 +251,10 @@ class HypermediaSupportBeanDefinitionRegistrar implements ImportBeanDefinitionRe
|
||||
adapter.setMessageConverters(potentiallyRegisterModule(adapter.getMessageConverters()));
|
||||
}
|
||||
|
||||
if (bean instanceof AnnotationMethodHandlerAdapter) {
|
||||
if (bean instanceof RequestMappingHandlerAdapter) {
|
||||
|
||||
AnnotationMethodHandlerAdapter adapter = (AnnotationMethodHandlerAdapter) bean;
|
||||
List<HttpMessageConverter<?>> augmentedConverters = potentiallyRegisterModule(
|
||||
Arrays.asList(adapter.getMessageConverters()));
|
||||
adapter
|
||||
.setMessageConverters(augmentedConverters.toArray(new HttpMessageConverter<?>[augmentedConverters.size()]));
|
||||
RequestMappingHandlerAdapter adapter = (RequestMappingHandlerAdapter) bean;
|
||||
adapter.setMessageConverters(potentiallyRegisterModule(adapter.getMessageConverters()));
|
||||
}
|
||||
|
||||
if (bean instanceof RestTemplate) {
|
||||
|
||||
@@ -19,7 +19,6 @@ import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -50,7 +49,6 @@ import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
||||
import org.springframework.web.method.support.HandlerMethodArgumentResolverComposite;
|
||||
import org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
|
||||
|
||||
@@ -62,7 +60,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class EnableHypermediaSupportIntegrationTest {
|
||||
|
||||
@@ -152,13 +149,13 @@ public class EnableHypermediaSupportIntegrationTest {
|
||||
private static void assertEntityLinksSetUp(ApplicationContext context) {
|
||||
|
||||
Map<String, EntityLinks> discoverers = context.getBeansOfType(EntityLinks.class);
|
||||
assertThat(discoverers.values(), Matchers.<EntityLinks> hasItem(instanceOf(DelegatingEntityLinks.class)));
|
||||
assertThat(discoverers.values(), Matchers.<EntityLinks>hasItem(instanceOf(DelegatingEntityLinks.class)));
|
||||
}
|
||||
|
||||
private static void assertRelProvidersSetUp(ApplicationContext context) {
|
||||
|
||||
Map<String, RelProvider> discoverers = context.getBeansOfType(RelProvider.class);
|
||||
assertThat(discoverers.values(), Matchers.<RelProvider> hasItem(instanceOf(DelegatingRelProvider.class)));
|
||||
assertThat(discoverers.values(), Matchers.<RelProvider>hasItem(instanceOf(DelegatingRelProvider.class)));
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
@@ -171,11 +168,7 @@ public class EnableHypermediaSupportIntegrationTest {
|
||||
|
||||
RequestMappingHandlerAdapter rmha = context.getBean(RequestMappingHandlerAdapter.class);
|
||||
assertThat(rmha.getMessageConverters(),
|
||||
Matchers.<HttpMessageConverter<?>> hasItems(instanceOf(MappingJackson2HttpMessageConverter.class)));
|
||||
|
||||
AnnotationMethodHandlerAdapter amha = context.getBean(AnnotationMethodHandlerAdapter.class);
|
||||
assertThat(Arrays.asList(amha.getMessageConverters()),
|
||||
Matchers.<HttpMessageConverter<?>> hasItems(instanceOf(MappingJackson2HttpMessageConverter.class)));
|
||||
Matchers.<HttpMessageConverter<?>>hasItems(instanceOf(MappingJackson2HttpMessageConverter.class)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -215,13 +208,6 @@ public class EnableHypermediaSupportIntegrationTest {
|
||||
return adapter;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AnnotationMethodHandlerAdapter amha() {
|
||||
AnnotationMethodHandlerAdapter adapter = new AnnotationMethodHandlerAdapter();
|
||||
numberOfMessageConvertersLegacy = adapter.getMessageConverters().length;
|
||||
return adapter;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RestTemplate restTemplate() {
|
||||
return new RestTemplate();
|
||||
|
||||
Reference in New Issue
Block a user