@Test
public void intercept_ServiceWithExistingQueryParameters_ProxyTicketAsQueryEscapedParameter() throws IOException {

    String service = "http://httpbin.org/get?a=test&x=test2&c=%22test3%22";
    ClientHttpRequestExecution clientHttpRequestExecution = mock(ClientHttpRequestExecution.class);
    ClientHttpRequest request = new MockClientHttpRequest(HttpMethod.GET, URI.create(service));
    String proxyTicket = "PT-21-c1gk6jBcfYnatLbNExfx-0623277bc36a";
    when(proxyTicketProvider.getProxyTicket(service)).thenReturn(proxyTicket);
    casAuthorizationInterceptor.intercept(request, null, clientHttpRequestExecution);
    verify(proxyTicketProvider, times(1)).getProxyTicket(service);
    verify(clientHttpRequestExecution, times(1)).execute(httpRequestArgumentCaptor.capture(), isNull());
    assertThat(httpRequestArgumentCaptor.getValue().getURI().toASCIIString())
            .isEqualTo(service + "&ticket=" + proxyTicket);
}