@Test
public void buildDetails_WithCustomProxyCallbackAndServiceAuthenticationDetails_DelegateTo() {

    ServiceProperties serviceProperties = new LaxServiceProperties();
    ProxyCallbackAndServiceAuthenticationDetailsSource authenticationDetailsSource =
            new ProxyCallbackAndServiceAuthenticationDetailsSource(serviceProperties,
                    new ProxyCallbackAndServiceAuthenticationDetails() {
                        private static final long serialVersionUID = 197549373788141292L;
                        @Override
                        public String getProxyCallbackUrl() {
                            return "http://bat.man/callback";
                        }
                        @Override
                        public void setContext(HttpServletRequest context) {
                            // do nothing
                        }
                        @Override
                        public String getServiceUrl() {
                            return "http://bat.man/";
                        }
                    });
    ServiceAuthenticationDetails serviceAuthenticationDetails =
            authenticationDetailsSource.buildDetails(new MockHttpServletRequest());
    assertThat(serviceAuthenticationDetails).isInstanceOf(ProxyCallbackAndServiceAuthenticationDetails.class);
    assertThat(serviceAuthenticationDetails.getServiceUrl()).isEqualTo("http://bat.man/");
    assertThat(((ProxyCallbackAndServiceAuthenticationDetails) serviceAuthenticationDetails).getProxyCallbackUrl())
            .isEqualTo("http://bat.man/callback");
}