### Question:
GoogleTokenProvider extends SynchronousProvider implements AuthenticationProvider, OutboundSecurityProvider { public static Builder builder() { return new Builder(); } private  GoogleTokenProvider(Builder builder); static GoogleTokenProvider create(Config config); static Builder builder(); @Override boolean isOutboundSupported(ProviderRequest providerRequest,
                                       SecurityEnvironment outboundEnv,
                                       EndpointConfig outboundConfig);  }### Answer:
@Test public void testInboundInvalidToken() throws ExecutionException, InterruptedException, GeneralSecurityException, IOException { GoogleIdTokenVerifier verifier = mock(GoogleIdTokenVerifier.class); when(verifier.verify(TOKEN_VALUE)).thenReturn(null); GoogleTokenProvider provider = GoogleTokenProvider.builder().clientId("clientId").verifier(verifier).build(); ProviderRequest inboundRequest = createInboundRequest("Authorization", "bearer " + TOKEN_VALUE); AuthenticationResponse response = provider.authenticate(inboundRequest).toCompletableFuture().get(); assertThat(response.status(), is(SecurityResponse.SecurityStatus.FAILURE)); assertThat(response.statusCode().orElse(200), is(401)); assertThat(response.responseHeaders().get("WWW-Authenticate"), notNullValue()); }
@Test public void testInboundVerificationException() throws ExecutionException, InterruptedException, GeneralSecurityException, IOException { GoogleIdTokenVerifier verifier = mock(GoogleIdTokenVerifier.class); when(verifier.verify(TOKEN_VALUE)).thenThrow(new IOException("Failed to verify token")); GoogleTokenProvider provider = GoogleTokenProvider.builder().clientId("clientId").verifier(verifier).build(); ProviderRequest inboundRequest = createInboundRequest("Authorization", "bearer " + TOKEN_VALUE); AuthenticationResponse response = provider.authenticate(inboundRequest).toCompletableFuture().get(); assertThat(response.status(), is(SecurityResponse.SecurityStatus.FAILURE)); assertThat(response.statusCode().orElse(200), is(401)); assertThat(response.responseHeaders().get("WWW-Authenticate"), notNullValue()); }