### Question:
ProxyCallbackAndServiceAuthenticationDetailsSource extends ServiceAuthenticationDetailsSource { @Override public ServiceAuthenticationDetails buildDetails(HttpServletRequest context) { serviceAuthenticationDetails.setContext(context); return serviceAuthenticationDetails; } ProxyCallbackAndServiceAuthenticationDetailsSource(ServiceProperties serviceProperties,
            ProxyCallbackAndServiceAuthenticationDetails serviceAuthenticationDetails);  ProxyCallbackAndServiceAuthenticationDetailsSource(ServiceProperties serviceProperties,
            URI proxyCallbackUri); @Override ServiceAuthenticationDetails buildDetails(HttpServletRequest context);  }### Answer:
@Test public void buildDetails_WithUri_DefaultProxyCallbackAndServiceAuthenticationDetails() { ServiceProperties serviceProperties = new LaxServiceProperties(); ProxyCallbackAndServiceAuthenticationDetailsSource authenticationDetailsSource = new ProxyCallbackAndServiceAuthenticationDetailsSource(serviceProperties, URI.create("/cas/callback")); MockHttpServletRequest context = new MockHttpServletRequest(); ServiceAuthenticationDetails serviceAuthenticationDetails = authenticationDetailsSource.buildDetails(context); assertThat(serviceAuthenticationDetails) .isInstanceOf(DefaultProxyCallbackAndServiceAuthenticationDetails.class); assertThat(serviceAuthenticationDetails.getServiceUrl()).isEqualTo("http: assertThat(((ProxyCallbackAndServiceAuthenticationDetails) serviceAuthenticationDetails).getProxyCallbackUrl()) .isEqualTo("http: }
@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: } @Override public void setContext(HttpServletRequest context) { } @Override public String getServiceUrl() { return "http: } }); ServiceAuthenticationDetails serviceAuthenticationDetails = authenticationDetailsSource.buildDetails(new MockHttpServletRequest()); assertThat(serviceAuthenticationDetails).isInstanceOf(ProxyCallbackAndServiceAuthenticationDetails.class); assertThat(serviceAuthenticationDetails.getServiceUrl()).isEqualTo("http: assertThat(((ProxyCallbackAndServiceAuthenticationDetails) serviceAuthenticationDetails).getProxyCallbackUrl()) .isEqualTo("http: }