@Test public void shouldUpdateCallbackFromRequest() throws RestAuthCallbackHandlerResponseException { HttpHeaders headers = mock(HttpHeaders.class); HttpServletRequest request = mock(HttpServletRequest.class); HttpServletResponse response = mock(HttpServletResponse.class); X509CertificateCallback x509CertificateCallback = mock(X509CertificateCallback.class); X509Certificate x509Certificate = mock(X509Certificate.class); X509Certificate[] x509Certificates = new X509Certificate[]{x509Certificate}; given(request.getAttribute("javax.servlet.request.X509Certificate")).willReturn(x509Certificates); boolean updated = restAuthX509CallbackHandler.updateCallbackFromRequest(headers, request, response, x509CertificateCallback); verify(x509CertificateCallback).setCertificate(x509Certificate); assertTrue(updated); }
public boolean updateCallbackFromRequest(HttpHeaders headers, HttpServletRequest request, HttpServletResponse response, X509CertificateCallback callback) { X509Certificate[] certificates = (X509Certificate[]) request.getAttribute( "javax.servlet.request.X509Certificate"); if (certificates != null && certificates.length > 0) { callback.setCertificate(certificates[0]); } return true; }
RestAuthX509CallbackHandler extends AbstractRestAuthCallbackHandler<X509CertificateCallback> { public boolean updateCallbackFromRequest(HttpHeaders headers, HttpServletRequest request, HttpServletResponse response, X509CertificateCallback callback) { X509Certificate[] certificates = (X509Certificate[]) request.getAttribute( "javax.servlet.request.X509Certificate"); if (certificates != null && certificates.length > 0) { callback.setCertificate(certificates[0]); } return true; } }
RestAuthX509CallbackHandler extends AbstractRestAuthCallbackHandler<X509CertificateCallback> { public boolean updateCallbackFromRequest(HttpHeaders headers, HttpServletRequest request, HttpServletResponse response, X509CertificateCallback callback) { X509Certificate[] certificates = (X509Certificate[]) request.getAttribute( "javax.servlet.request.X509Certificate"); if (certificates != null && certificates.length > 0) { callback.setCertificate(certificates[0]); } return true; }  }
RestAuthX509CallbackHandler extends AbstractRestAuthCallbackHandler<X509CertificateCallback> { public boolean updateCallbackFromRequest(HttpHeaders headers, HttpServletRequest request, HttpServletResponse response, X509CertificateCallback callback) { X509Certificate[] certificates = (X509Certificate[]) request.getAttribute( "javax.servlet.request.X509Certificate"); if (certificates != null && certificates.length > 0) { callback.setCertificate(certificates[0]); } return true; }  boolean updateCallbackFromRequest(HttpHeaders headers, HttpServletRequest request,
            HttpServletResponse response, X509CertificateCallback callback); X509CertificateCallback handle(HttpHeaders headers, HttpServletRequest request, HttpServletResponse response,
            JsonValue postBody, X509CertificateCallback originalCallback); String getCallbackClassName(); JsonValue convertToJson(X509CertificateCallback callback, int index); X509CertificateCallback convertFromJson(X509CertificateCallback callback, JsonValue jsonCallback); }
RestAuthX509CallbackHandler extends AbstractRestAuthCallbackHandler<X509CertificateCallback> { public boolean updateCallbackFromRequest(HttpHeaders headers, HttpServletRequest request, HttpServletResponse response, X509CertificateCallback callback) { X509Certificate[] certificates = (X509Certificate[]) request.getAttribute( "javax.servlet.request.X509Certificate"); if (certificates != null && certificates.length > 0) { callback.setCertificate(certificates[0]); } return true; }  boolean updateCallbackFromRequest(HttpHeaders headers, HttpServletRequest request,
            HttpServletResponse response, X509CertificateCallback callback); X509CertificateCallback handle(HttpHeaders headers, HttpServletRequest request, HttpServletResponse response,
            JsonValue postBody, X509CertificateCallback originalCallback); String getCallbackClassName(); JsonValue convertToJson(X509CertificateCallback callback, int index); X509CertificateCallback convertFromJson(X509CertificateCallback callback, JsonValue jsonCallback);  }