@Test
public void authenticate_WithNullTicketValidator_DoNothing() {

    DynamicProxyCallbackUrlCasAuthenticationProvider authenticationProvider =
            new DynamicProxyCallbackUrlCasAuthenticationProvider();
    authenticationProvider.setTicketValidator(null);
    when(authentication.getDetails()).thenReturn(new ProxyCallbackAndServiceAuthenticationDetails() {
        private static final long serialVersionUID = 2171667909966987793L;
        @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();
}