source: class WebAuthnProcessingFilterTest {
  
      @Rule
      public MockitoRule mockito;
      private ServerPropertyProvider serverPropertyProvider;
      private AuthenticationManager authenticationManager;
      private MockHttpServletRequest mockHttpServletRequest;
      private MockHttpServletResponse mockHttpServletResponse;
      @Spy
      private WebAuthnProcessingFilter target;
      private final ArgumentCaptor<Authentication> captor;
  
      @Test
      public void attemptAuthentication_test_with_credential() {
  
target: 
          String credentialId = "AAhdofeLeQWG6Y6gwwytZKNCDFB1WaIgqDsOwVYR5UavKQhAti4ic9_Dz-_CQEPpN0To6hiDRSCvmFHXaG6HK5yvvhm4DJRVJXzSvZiq5NefbXSYIr2uUaKbsoBe1lulhNdL9dRt6Dkkp38uq02YIR5CDaoxD-HQgMsS667aWlhHVKE884Sq0d1VVgGTDb1ds-Py_H7CDqk9SDErb8-XtQ9L";
          String clientDataJSON = "eyJjaGFsbGVuZ2UiOiJGT3JHWklmSFJfeURaSklydTVPdXBBIiwiaGFzaEFsZyI6IlMyNTYiLCJvcmlnaW4iOiJsb2NhbGhvc3QifQ";
          String authenticatorData = "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2MBAAABaQ";
          String signature = "MEUCIGBYMUVg2KkMG7V7UEsGxUeKVaO8x587JyVoZkk6FmsgAiEA5XRKxlYe2Vpwn-JYEJhcEVJ3-0nYFG-JfheOk4rA3dc";
          String clientExtensionsJSON = "";
  
          ServerProperty serverProperty = mock(ServerProperty.class);
  
  
          //Given
          mockHttpServletRequest.setMethod("POST");
          mockHttpServletRequest.setServerName("example.com");
          mockHttpServletRequest.setParameter("credentialId", credentialId);
          mockHttpServletRequest.setParameter("clientDataJSON", clientDataJSON);
          mockHttpServletRequest.setParameter("authenticatorData", authenticatorData);
          mockHttpServletRequest.setParameter("signature", signature);
          mockHttpServletRequest.setParameter("clientExtensionsJSON", clientExtensionsJSON);
  
          when(authenticationManager.authenticate(captor.capture())).thenReturn(null);
          when(serverPropertyProvider.provide(any())).thenReturn(serverProperty);
  
          //When
          target.attemptAuthentication(mockHttpServletRequest, mockHttpServletResponse);
  
          //Then
          WebAuthnAssertionAuthenticationToken authenticationToken = (WebAuthnAssertionAuthenticationToken) captor.getValue();
          verify(serverPropertyProvider).provide(mockHttpServletRequest);
  
          assertThat(authenticationToken.getPrincipal()).isNull();
  
          assertThat(authenticationToken.getCredentials()).isInstanceOf(WebAuthnAuthenticationRequest.class);
          assertThat(authenticationToken.getCredentials().getCredentialId()).isEqualTo(Base64UrlUtil.decode(credentialId));
          assertThat(authenticationToken.getCredentials().getClientDataJSON()).isEqualTo(Base64UrlUtil.decode(clientDataJSON));
          assertThat(authenticationToken.getCredentials().getAuthenticatorData()).isEqualTo(Base64UrlUtil.decode(authenticatorData));
          assertThat(authenticationToken.getCredentials().getSignature()).isEqualTo(Base64UrlUtil.decode(signature));
          assertThat(authenticationToken.getCredentials().getClientExtensionsJSON()).isEqualTo(clientExtensionsJSON);
  
          assertThat(authenticationToken.getParameters().getServerProperty()).isEqualTo(serverProperty);
  
      }
  
  }