@Test void testFilteredSyncRetrievesFilteredIpaState() throws Exception { FreeIpaClient freeIpaClient = mock(FreeIpaClient.class); UmsUsersState umsUsersState = mock(UmsUsersState.class); ImmutableSet<String> workloadUsers = mock(ImmutableSet.class); when(umsUsersState.getRequestedWorkloadUsernames()).thenReturn(workloadUsers); underTest.getIpaUserState(freeIpaClient, umsUsersState, false); verify(freeIpaUsersStateProvider).getFilteredFreeIpaState(any(), eq(workloadUsers)); }
@VisibleForTesting UsersState getIpaUserState(FreeIpaClient freeIpaClient, UmsUsersState umsUsersState, boolean fullSync) throws FreeIpaClientException { return fullSync ? freeIpaUsersStateProvider.getUsersState(freeIpaClient) : freeIpaUsersStateProvider.getFilteredFreeIpaState( freeIpaClient, umsUsersState.getRequestedWorkloadUsernames()); }
UserSyncService { @VisibleForTesting UsersState getIpaUserState(FreeIpaClient freeIpaClient, UmsUsersState umsUsersState, boolean fullSync) throws FreeIpaClientException { return fullSync ? freeIpaUsersStateProvider.getUsersState(freeIpaClient) : freeIpaUsersStateProvider.getFilteredFreeIpaState( freeIpaClient, umsUsersState.getRequestedWorkloadUsernames()); } }
UserSyncService { @VisibleForTesting UsersState getIpaUserState(FreeIpaClient freeIpaClient, UmsUsersState umsUsersState, boolean fullSync) throws FreeIpaClientException { return fullSync ? freeIpaUsersStateProvider.getUsersState(freeIpaClient) : freeIpaUsersStateProvider.getFilteredFreeIpaState( freeIpaClient, umsUsersState.getRequestedWorkloadUsernames()); }  }
UserSyncService { @VisibleForTesting UsersState getIpaUserState(FreeIpaClient freeIpaClient, UmsUsersState umsUsersState, boolean fullSync) throws FreeIpaClientException { return fullSync ? freeIpaUsersStateProvider.getUsersState(freeIpaClient) : freeIpaUsersStateProvider.getFilteredFreeIpaState( freeIpaClient, umsUsersState.getRequestedWorkloadUsernames()); }  Operation synchronizeUsers(String accountId, String actorCrn, Set<String> environmentCrnFilter,
            Set<String> userCrnFilter, Set<String> machineUserCrnFilter); Operation synchronizeUsersWithCustomPermissionCheck(String accountId, String actorCrn, Set<String> environmentCrnFilter,
            UserSyncRequestFilter userSyncFilter, AuthorizationResourceAction action); }
UserSyncService { @VisibleForTesting UsersState getIpaUserState(FreeIpaClient freeIpaClient, UmsUsersState umsUsersState, boolean fullSync) throws FreeIpaClientException { return fullSync ? freeIpaUsersStateProvider.getUsersState(freeIpaClient) : freeIpaUsersStateProvider.getFilteredFreeIpaState( freeIpaClient, umsUsersState.getRequestedWorkloadUsernames()); }  Operation synchronizeUsers(String accountId, String actorCrn, Set<String> environmentCrnFilter,
            Set<String> userCrnFilter, Set<String> machineUserCrnFilter); Operation synchronizeUsersWithCustomPermissionCheck(String accountId, String actorCrn, Set<String> environmentCrnFilter,
            UserSyncRequestFilter userSyncFilter, AuthorizationResourceAction action);  }