assertEquals(uri, determinedUri);
}
@Test
public void testClientCredentialsTokenRequest() {
AccessTokenRequest accessTokenRequest = new AccessTokenRequest();
accessTokenRequest.setGrantType(OAuth2Validator.GRANT_TYPE_CLIENT_CREDENTIALS);
accessTokenRequest.setClientId(client.getClientId());
ValidationResponse response = validator.validate(accessTokenRequest,
BasicAuthCredentials.createCredentialsFromHeader(null));
assertEquals(ValidationResponse.CLIENT_CREDENTIALS_NOT_PERMITTED, response);
assertNull(accessTokenRequest.getClient());
client.setAllowedClientCredentials(true);
response = validator.validate(accessTokenRequest,
BasicAuthCredentials.createCredentialsFromHeader(null));
assertEquals(ValidationResponse.VALID, response);
assertEquals(client, accessTokenRequest.getClient());
}