@BeforeMethod @SuppressWarnings("unchecked") public void setup() throws Exception { dataStore = mock(TokenDataStore.class); OAuth2ProviderSettingsFactory providerSettingsFactory = mock(OAuth2ProviderSettingsFactory.class); OAuth2UrisFactory<RealmInfo> oAuth2UrisFactory = mock(OAuth2UrisFactory.class); OAuth2Uris oAuth2Uris = mock(OAuth2Uris.class); TokenIdGenerator idGenerator = mock(TokenIdGenerator.class); store = new OpenAMResourceSetStore( "REALM", providerSettingsFactory, oAuth2UrisFactory, idGenerator, dataStore); given(oAuth2UrisFactory.get(Matchers.<OAuth2Request>anyObject())).willReturn(oAuth2Uris); given(oAuth2Uris.getResourceSetRegistrationPolicyEndpoint(anyString())) .willReturn("POLICY_URI"); }
@Override public URI getDynamicClientEndpoint() { return URI.create(oauth2Uris.getClientRegistrationEndpoint()); }
@Override public URI getResourceSetRegistrationEndpoint() { return URI.create(oauth2Uris.getResourceSetRegistrationEndpoint()); }
@Override public URI getTokenIntrospectionEndpoint() { return URI.create(oauth2Uris.getIntrospectionEndpoint()); }
@Override public URI getAuthorizationEndpoint() { return URI.create(oauth2Uris.getAuthorizationEndpoint()); }
@Override public URI getTokenEndpoint() { return URI.create(oauth2Uris.getTokenEndpoint()); }
@Override public URI getIssuer() throws ServerException { return URI.create(oauth2Uris.getIssuer()); }