RemoteUserFederationProvider implements UserFederationProvider { @Override public UserModel getUserByEmail(RealmModel realm, String email) { LOG.infof("Get by email: %s", email); try { return this.createUserModel(realm, email); } catch (NotFoundException ex) { LOG.error("Federated user (by email) not found: " + email); return null; } } RemoteUserFederationProvider(KeycloakSession session, UserFederationProviderModel model, String uri); protected  RemoteUserFederationProvider(KeycloakSession session, UserFederationProviderModel model, FederatedUserService federatedUserService); @Override boolean synchronizeRegistrations(); @Override UserModel register(RealmModel realm, UserModel user); @Override boolean removeUser(RealmModel realm, UserModel user); @Override UserModel getUserByUsername(RealmModel realm, String username); @Override UserModel getUserByEmail(RealmModel realm, String email); @Override List<UserModel> searchByAttributes(Map<String, String> attributes, RealmModel realm, int maxResults); @Override void preRemove(RealmModel realm); @Override void preRemove(RealmModel realm, RoleModel role); @Override void preRemove(RealmModel realm, GroupModel group); @Override Set<String> getSupportedCredentialTypes(UserModel user); @Override Set<String> getSupportedCredentialTypes(); @Override boolean validCredentials(RealmModel realm, UserModel user, List<UserCredentialModel> input); @Override boolean validCredentials(RealmModel realm, UserModel user, UserCredentialModel... input); @Override CredentialValidationOutput validCredentials(RealmModel realm, UserCredentialModel credential); @Override UserModel validateAndProxy(RealmModel realm, UserModel local); @Override boolean isValid(RealmModel realm, UserModel local); @Override void close();  }
@Test public void testGetUserByEmail() throws Exception { assertNotNull(provider.getUserByUsername(realmModel, FEDERATED_USER_KNOWN_EMAIL)); verify(federatedUserService).getUserDetails(eq(FEDERATED_USER_KNOWN_EMAIL)); }