@Test public void testFindPrincipalsQueryFails() throws ParseException { QueryEngine qe = mock(QueryEngine.class); when(qe.executeQuery(anyString(), anyString(), anyLong(), anyLong(), any(Map.class), any(Map.class))).thenThrow(new ParseException("err",0)); Root r = when(mock(Root.class).getQueryEngine()).thenReturn(qe).getMock(); UserPrincipalProvider upp = new UserPrincipalProvider(r, getUserConfiguration(), NamePathMapper.DEFAULT); Iterator<? extends Principal> it = upp.findPrincipals("a", false, PrincipalManager.SEARCH_TYPE_ALL, -1, -1); assertNotNull(it); assertFalse(it.hasNext()); }
@NotNull @Override public Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final int searchType) { return findPrincipals(nameHint, false, searchType, 0, -1); }
UserPrincipalProvider implements PrincipalProvider { @NotNull @Override public Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final int searchType) { return findPrincipals(nameHint, false, searchType, 0, -1); } }
UserPrincipalProvider implements PrincipalProvider { @NotNull @Override public Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final int searchType) { return findPrincipals(nameHint, false, searchType, 0, -1); } UserPrincipalProvider(@NotNull Root root,
                          @NotNull UserConfiguration userConfiguration,
                          @NotNull NamePathMapper namePathMapper); }
UserPrincipalProvider implements PrincipalProvider { @NotNull @Override public Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final int searchType) { return findPrincipals(nameHint, false, searchType, 0, -1); } UserPrincipalProvider(@NotNull Root root,
                          @NotNull UserConfiguration userConfiguration,
                          @NotNull NamePathMapper namePathMapper); @Override Principal getPrincipal(@NotNull String principalName); @Nullable @Override ItemBasedPrincipal getItemBasedPrincipal(@NotNull String principalOakPath); @NotNull @Override Set<Principal> getMembershipPrincipals(@NotNull Principal principal); @NotNull @Override Set<? extends Principal> getPrincipals(@NotNull String userID); @NotNull @Override Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final int searchType); @NotNull @Override Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final boolean fullText, final int searchType, long offset,
            long limit); @NotNull @Override Iterator<? extends Principal> findPrincipals(int searchType); }
UserPrincipalProvider implements PrincipalProvider { @NotNull @Override public Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final int searchType) { return findPrincipals(nameHint, false, searchType, 0, -1); } UserPrincipalProvider(@NotNull Root root,
                          @NotNull UserConfiguration userConfiguration,
                          @NotNull NamePathMapper namePathMapper); @Override Principal getPrincipal(@NotNull String principalName); @Nullable @Override ItemBasedPrincipal getItemBasedPrincipal(@NotNull String principalOakPath); @NotNull @Override Set<Principal> getMembershipPrincipals(@NotNull Principal principal); @NotNull @Override Set<? extends Principal> getPrincipals(@NotNull String userID); @NotNull @Override Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final int searchType); @NotNull @Override Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final boolean fullText, final int searchType, long offset,
            long limit); @NotNull @Override Iterator<? extends Principal> findPrincipals(int searchType);  }