Coverage Report - com.ctrip.apollo.common.controller.WebMvcConfig
 
Classes in this File Line Coverage Branch Coverage Complexity
WebMvcConfig
0%
0/7
N/A
1
 
 1  
 package com.ctrip.apollo.common.controller;
 2  
 
 3  
 import java.util.List;
 4  
 
 5  
 import org.springframework.context.annotation.Configuration;
 6  
 import org.springframework.data.domain.PageRequest;
 7  
 import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
 8  
 import org.springframework.http.MediaType;
 9  
 import org.springframework.web.method.support.HandlerMethodArgumentResolver;
 10  
 import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
 11  
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
 12  
 
 13  
 @Configuration
 14  0
 public class WebMvcConfig extends WebMvcConfigurerAdapter {
 15  
 
 16  
   @Override
 17  
   public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
 18  0
     PageableHandlerMethodArgumentResolver pageResolver =
 19  
             new PageableHandlerMethodArgumentResolver();
 20  0
     pageResolver.setFallbackPageable(new PageRequest(0, 10));
 21  
 
 22  0
     argumentResolvers.add(pageResolver);
 23  0
   }
 24  
 
 25  
   @Override
 26  
   public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
 27  0
     configurer.ignoreAcceptHeader(true).defaultContentType(MediaType.APPLICATION_JSON);
 28  0
   }
 29  
 
 30  
 }