@Before
  public void setup() {
    clientCredentialsResource = new ClientCredentialsResourceDetails();
    clientCredentialsResource.setClientId(environment.getProperty("uaa_client_id"));
    clientCredentialsResource.setClientSecret(environment.getProperty("uaa_client_secret"));
    clientCredentialsResource.setAccessTokenUri(environment.getProperty("uaa_oauth_token_url"));

    oAuth2RestTemplate = new OAuth2RestTemplate(clientCredentialsResource);
  }
 public IdentityClient(Object target) {
   IdentityZoneEndpointsIntegrationTests test = (IdentityZoneEndpointsIntegrationTests) target;
   ClientCredentialsResourceDetails resource =
       test.testAccounts.getClientCredentialsResource(
           new String[] {"zones.write"}, "identity", "identitysecret");
   setClientId(resource.getClientId());
   setClientSecret(resource.getClientSecret());
   setId(getClientId());
   setAccessTokenUri(test.serverRunning.getAccessTokenUri());
 }