@Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
            throws IOException, ServletException {
        if (!StringUtils.containsIgnoreCase(request.getContentType(), MediaType.MULTIPART_FORM_DATA)
                && !StringUtils.containsIgnoreCase(request.getContentType(), MediaType.APPLICATION_OCTET_STREAM)) {
            interceptor.onFilter(request, response, chain);
        } else {
            chain.doFilter(request, response);
        }
    }
@Test
    public void testInterceptorOnFilter() throws ServletException, IOException {
        PulsarService mockPulsarService = Mockito.mock(PulsarService.class);
        BrokerInterceptor spyInterceptor = Mockito.spy(BrokerInterceptor.class);
        HttpServletRequest mockHttpServletRequest = Mockito.mock(HttpServletRequest.class);
        HttpServletResponse mockHttpServletResponse = Mockito.mock(HttpServletResponse.class);
        ServiceConfiguration config = new ServiceConfiguration();
        FilterChain mockFilterChain = Mockito.mock(FilterChain.class);
        Mockito.doReturn(spyInterceptor).when(mockPulsarService).getBrokerInterceptor();
        Mockito.doReturn(config).when(mockPulsarService).getConfig();
        config.setBrokerInterceptors(Sets.newHashSet("Interceptor1", "Interceptor2"));
        ProcessHandlerFilter processHandlerFilter = new ProcessHandlerFilter(mockPulsarService.getBrokerInterceptor());
        processHandlerFilter.doFilter(mockHttpServletRequest, mockHttpServletResponse, mockFilterChain);
        Mockito.verify(spyInterceptor).onFilter(mockHttpServletRequest, mockHttpServletResponse, mockFilterChain);
    }