/** * @return An {@link OrderedHttpPutFormContentFilter} that suppresses the FormContent filtering. */ @Bean public OrderedHttpPutFormContentFilter httpPutFormContentFilter() { return new OrderedHttpPutFormContentFilter() { @Override protected boolean shouldNotFilter(final HttpServletRequest request) throws ServletException { return true; } }; }
@Test public void httpPutFormContentFilterCanBeOverridden() { load(CustomHttpPutFormContentFilter.class); assertThat(this.context.getBeansOfType(OrderedHttpPutFormContentFilter.class)) .hasSize(0); assertThat(this.context.getBeansOfType(HttpPutFormContentFilter.class)) .hasSize(1); }
@Bean @ConditionalOnMissingBean(HttpPutFormContentFilter.class) public OrderedHttpPutFormContentFilter httpPutFormContentFilter() { return new OrderedHttpPutFormContentFilter(); }
@Bean public OrderedHttpPutFormContentFilter httpPutFormContentFilter() { return new OrderedHttpPutFormContentFilter(); }
@Test public void httpPutFormContentFilterIsAutoConfigured() { load(); assertThat(this.context.getBeansOfType(OrderedHttpPutFormContentFilter.class)) .hasSize(1); }