@Test
public void doFilter_with_error_test() throws IOException, ServletException {

    AssertionOptionsProvider optionsProvider = mock(AssertionOptionsProvider.class);
    doThrow(new RuntimeException()).when(optionsProvider).getAssertionOptions(any(), any());
    AssertionOptionsEndpointFilter optionsEndpointFilter = new AssertionOptionsEndpointFilter(optionsProvider, objectConverter);
    AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl();
    optionsEndpointFilter.setTrustResolver(trustResolver);
    MockHttpServletRequest request = new MockHttpServletRequest();
    request.setRequestURI(AssertionOptionsEndpointFilter.FILTER_URL);
    MockHttpServletResponse response = new MockHttpServletResponse();
    MockFilterChain filterChain = new MockFilterChain();
    optionsEndpointFilter.doFilter(request, response, filterChain);
    assertThat(response.getStatus()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR.value());
}