@Test
public void discoverWhenProviderSupportsDiscoveryThenReturnProviderConfiguration() throws Exception {

	this.server.enqueue(new MockResponse().setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE).setBody(
			"	{\n" +
			"   	\"issuer\": \"https://springsecurity.uaa.run.pivotal.io/oauth/token\",\n" +
			"   	\"authorization_endpoint\": \"https://springsecurity.login.run.pivotal.io/oauth/authorize\",\n" +
			"   	\"token_endpoint\": \"https://springsecurity.login.run.pivotal.io/oauth/token\",\n" +
			"   	\"userinfo_endpoint\": \"https://springsecurity.login.run.pivotal.io/userinfo\",\n" +
			"   	\"jwks_uri\": \"https://springsecurity.login.run.pivotal.io/token_keys\"\n" +
			"	}\n"));
	ProviderDiscoveryClient client = new ProviderDiscoveryClient(this.server.url("").toString());
	ProviderConfiguration providerConfiguration = client.discover();
	assertNotNull(providerConfiguration);
	assertEquals("https://springsecurity.uaa.run.pivotal.io/oauth/token", providerConfiguration.getIssuer().toString());
	assertEquals("https://springsecurity.login.run.pivotal.io/oauth/authorize", providerConfiguration.getAuthorizationEndpoint().toString());
	assertEquals("https://springsecurity.login.run.pivotal.io/oauth/token", providerConfiguration.getTokenEndpoint().toString());
	assertEquals("https://springsecurity.login.run.pivotal.io/userinfo", providerConfiguration.getUserInfoEndpoint().toString());
	assertEquals("https://springsecurity.login.run.pivotal.io/token_keys", providerConfiguration.getJwkSetUri().toString());
}