@Bean public WebMvcConfigurer captchaWebMvcConfigurer() { return new WebMvcConfigurerAdapter() { @Override public void extendMessageConverters(List<HttpMessageConverter<?>> converters) { BufferedImageHttpMessageConverter bufferedImageHttpMessageConverter = new BufferedImageHttpMessageConverter(); if (converters.size() > 0) { converters.add(converters.size() - 1, bufferedImageHttpMessageConverter); } else { converters.add(bufferedImageHttpMessageConverter); } } }; }
@BeforeMethod public void setUp() { mockMvc = MockMvcBuilders.standaloneSetup(captchaController) .setMessageConverters(new BufferedImageHttpMessageConverter(), new FormHttpMessageConverter(), new MolgenisGsonHttpMessageConverter(new Gson())) .build(); }
@Override public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { converters.add(gsonHttpMessageConverter); converters.add(new BufferedImageHttpMessageConverter()); converters.add(new CsvHttpMessageConverter()); converters.add(new ResourceHttpMessageConverter()); converters.add(new StringHttpMessageConverter()); converters.add(rdfConverter); }
@Override public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { converters.add(new BufferedImageHttpMessageConverter()); converters.add(new FormOAuth2AccessTokenMessageConverter()); }