@Test
public void authenticate_WithTicketValidatorNotInstanceOfCas20ServiceTicketValidator_DoNothing() {

    TicketValidator ticketValidator = mock(TicketValidator.class);
    DynamicProxyCallbackUrlCasAuthenticationProvider authenticationProvider =
            new DynamicProxyCallbackUrlCasAuthenticationProvider();
    authenticationProvider.setTicketValidator(ticketValidator);
    when(authentication.getDetails()).thenReturn(new ProxyCallbackAndServiceAuthenticationDetails() {
        private static final long serialVersionUID = 700055871632490815L;
        @Override
        public String getServiceUrl() {
            return "http://localhost";
        }
        @Override
        public String getProxyCallbackUrl() {
            return "http://localhost/cas/callback";
        }
        @Override
        public void setContext(HttpServletRequest context) {
            // do nothing
        }
    });
    authenticationProvider.authenticate(authentication);
    verify(authentication, times(1)).getDetails();
    verifyZeroInteractions(ticketValidator);
}