FacebookAuthHandler implements AuthHandler { @Nullable @Override public AuthProvider providerFor(@Nullable String strategy, @NonNull String connection) { if ("facebook".equals(strategy)) { return provider; } return null; } FacebookAuthHandler(@NonNull AuthenticationAPIClient apiClient);  FacebookAuthHandler(@NonNull FacebookAuthProvider provider); @Nullable @Override AuthProvider providerFor(@Nullable String strategy, @NonNull String connection);  }
@Test public void shouldGetFacebookProvider() throws Exception { assertThat(handler.providerFor("facebook", "facebook"), Is.<AuthProvider>is(provider)); }
@Test public void shouldGetFacebookProviderFromConnectionWithoutDefaultValue() throws Exception { assertThat(handler.providerFor("facebook", "facebook-2"), Is.<AuthProvider>is(provider)); }
@Test public void shouldGetNullProvider() throws Exception { assertThat(handler.providerFor("some-strategy", "some-connection"), is(nullValue())); }