ValidationUtil { public static URI validateRedirect(final URI redirect, final List<ClientRedirect> redirects) { if (redirect == null) { return validateRedirect((String) null, redirects); } return validateRedirect(redirect.toString(), redirects); } private  ValidationUtil(); static void validateResponseType(final Client client,
                                            final String responseType); static URI requireValidRedirect(
            final URI redirect, final List<ClientRedirect> redirects); static URI requireValidRedirect(
            final String redirect, final List<ClientRedirect> redirects); static URI requireValidRedirect(final String redirect,
                                           final Set<URI> redirects); static URI validateRedirect(final URI redirect,
                                       final List<ClientRedirect> redirects); static URI validateRedirect(final String redirect,
                                       final List<ClientRedirect> redirects); static URI validateRedirect(final URI redirect,
                                       final Set<URI> redirects); static URI validateRedirect(final String redirect,
                                       final Set<URI> redirects); static SortedMap<String, ApplicationScope> validateScope(
            final String[] requestedScopes,
            final SortedMap<String, ApplicationScope> validScopes); static SortedMap<String, ApplicationScope> validateScope(
            final String requestedScopes,
            final SortedMap<String, ApplicationScope> validScopes); static SortedMap<String, ApplicationScope> validateScope(
            final SortedMap<String, ApplicationScope> requestedScopes,
            final Role role); static SortedMap<String, ApplicationScope> validateScope(
            final String requestedScopes, final Role role); static SortedMap<String, ApplicationScope> revalidateScope(
            final String[] requestedScopes,
            final SortedMap<String, ApplicationScope> originalScopes,
            final SortedMap<String, ApplicationScope> validScopes); static SortedMap<String, ApplicationScope> revalidateScope(
            final String requestedScopes,
            final SortedMap<String, ApplicationScope> originalScopes,
            final SortedMap<String, ApplicationScope> validScopes); static SortedMap<String, ApplicationScope> revalidateScope(
            final String requestedScopes,
            final SortedMap<String, ApplicationScope> originalScopes,
            final Role role); static Authenticator validateAuthenticator(
            final AuthenticatorType type,
            final List<Authenticator> authenticators);  }
@Test public void testValidateRedirect() throws Exception { Set<URI> testSet = new HashSet<>(); testSet.add(new URI("http: testSet.add(new URI("http: URI result = ValidationUtil.requireValidRedirect("http: testSet); assertEquals("http: }
@Test public void testValidateUriRedirect() throws Exception { Set<URI> testSet = new HashSet<>(); testSet.add(new URI("http: testSet.add(new URI("http: URI result = ValidationUtil.validateRedirect( new URI("http: assertEquals("http: }
@Test public void testValidateNullUriRedirect() throws Exception { Set<URI> testSet = new HashSet<>(); testSet.add(new URI("http: testSet.add(new URI("http: URI result = ValidationUtil.validateRedirect((URI) null, testSet); assertNull(result); }
@Test public void testInvalidClientRedirects() throws Exception { List<ClientRedirect> testRedirects = new ArrayList<>(); ClientRedirect redirect1 = new ClientRedirect(); redirect1.setUri(new URI("http: testRedirects.add(redirect1); ClientRedirect redirect2 = new ClientRedirect(); redirect2.setUri(new URI("http: testRedirects.add(redirect2); URI result = ValidationUtil.validateRedirect("http: testRedirects); assertNull(result); }