19
19
import static org .junit .Assert .*;
20
20
21
21
import java .lang .reflect .Method ;
22
- import java .util .Arrays ;
23
22
import java .util .List ;
24
23
import java .util .Map ;
25
24
50
49
import org .springframework .web .client .RestTemplate ;
51
50
import org .springframework .web .method .support .HandlerMethodArgumentResolver ;
52
51
import org .springframework .web .method .support .HandlerMethodArgumentResolverComposite ;
53
- import org .springframework .web .servlet .mvc .annotation .AnnotationMethodHandlerAdapter ;
54
52
import org .springframework .web .servlet .mvc .method .annotation .AbstractMessageConverterMethodArgumentResolver ;
55
53
import org .springframework .web .servlet .mvc .method .annotation .RequestMappingHandlerAdapter ;
56
54
62
60
*
63
61
* @author Oliver Gierke
64
62
*/
65
- @ SuppressWarnings ("deprecation" )
66
63
@ RunWith (MockitoJUnitRunner .class )
67
64
public class EnableHypermediaSupportIntegrationTest {
68
65
@@ -152,13 +149,13 @@ public void configuresDefaultObjectMapperForHalToIgnoreUnknownProperties() {
152
149
private static void assertEntityLinksSetUp (ApplicationContext context ) {
153
150
154
151
Map <String , EntityLinks > discoverers = context .getBeansOfType (EntityLinks .class );
155
- assertThat (discoverers .values (), Matchers .<EntityLinks > hasItem (instanceOf (DelegatingEntityLinks .class )));
152
+ assertThat (discoverers .values (), Matchers .<EntityLinks >hasItem (instanceOf (DelegatingEntityLinks .class )));
156
153
}
157
154
158
155
private static void assertRelProvidersSetUp (ApplicationContext context ) {
159
156
160
157
Map <String , RelProvider > discoverers = context .getBeansOfType (RelProvider .class );
161
- assertThat (discoverers .values (), Matchers .<RelProvider > hasItem (instanceOf (DelegatingRelProvider .class )));
158
+ assertThat (discoverers .values (), Matchers .<RelProvider >hasItem (instanceOf (DelegatingRelProvider .class )));
162
159
}
163
160
164
161
@ SuppressWarnings ({ "unchecked" })
@@ -171,11 +168,7 @@ private static void assertHalSetupForConfigClass(Class<?> configClass) {
171
168
172
169
RequestMappingHandlerAdapter rmha = context .getBean (RequestMappingHandlerAdapter .class );
173
170
assertThat (rmha .getMessageConverters (),
174
- Matchers .<HttpMessageConverter <?>> hasItems (instanceOf (MappingJackson2HttpMessageConverter .class )));
175
-
176
- AnnotationMethodHandlerAdapter amha = context .getBean (AnnotationMethodHandlerAdapter .class );
177
- assertThat (Arrays .asList (amha .getMessageConverters ()),
178
- Matchers .<HttpMessageConverter <?>> hasItems (instanceOf (MappingJackson2HttpMessageConverter .class )));
171
+ Matchers .<HttpMessageConverter <?>>hasItems (instanceOf (MappingJackson2HttpMessageConverter .class )));
179
172
}
180
173
181
174
/**
@@ -215,13 +208,6 @@ public RequestMappingHandlerAdapter rmh() {
215
208
return adapter ;
216
209
}
217
210
218
- @ Bean
219
- public AnnotationMethodHandlerAdapter amha () {
220
- AnnotationMethodHandlerAdapter adapter = new AnnotationMethodHandlerAdapter ();
221
- numberOfMessageConvertersLegacy = adapter .getMessageConverters ().length ;
222
- return adapter ;
223
- }
224
-
225
211
@ Bean
226
212
public RestTemplate restTemplate () {
227
213
return new RestTemplate ();
0 commit comments