Skip to content

Commit

Permalink
Improved testing
Browse files Browse the repository at this point in the history
  • Loading branch information
hjmikkon committed Dec 22, 2017
1 parent ebf18a5 commit c3d45d0
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
package org.geant.idpextension.oidc.metadata.impl;

import java.io.File;
import java.net.URI;
import java.util.Set;

import org.geant.idpextension.oidc.criterion.ClientIDCriterion;
Expand All @@ -54,6 +55,7 @@ public class FilesystemClientInformationResolverTest {
FilesystemClientInformationResolver resolver;

String clientId;
URI redirectUri;

@BeforeMethod
public void initTests() throws Exception {
Expand All @@ -62,6 +64,7 @@ public void initTests() throws Exception {
resolver = new FilesystemClientInformationResolver(file);
resolver.setId("mockId");
resolver.initialize();
redirectUri = new URI("https://192.168.0.150/static");
}

@Test
Expand All @@ -77,6 +80,9 @@ public void testSuccess() throws Exception {
final OIDCClientInformation clientInfo = resolver.resolveSingle(new CriteriaSet(criterion));
Assert.assertNotNull(clientInfo);
Assert.assertEquals(clientInfo.getID().getValue(), clientId);
final Set<URI> redirectUris = clientInfo.getOIDCMetadata().getRedirectionURIs();
Assert.assertEquals(redirectUris.size(), 1);
Assert.assertTrue(redirectUris.contains(redirectUri));
final Scope scope = clientInfo.getOIDCMetadata().getScope();
Assert.assertEquals(scope.size(), 6);
Assert.assertTrue(scope.contains(OIDCScopeValue.OPENID));
Expand Down

0 comments on commit c3d45d0

Please sign in to comment.