// Path: spring-cloud-services-spring-connector/src/test/java/io/pivotal/spring/cloud/MockCloudConnector.java
// public class MockCloudConnector implements CloudConnector {
// 
// 	public static final CloudConnector instance = Mockito.mock(CloudConnector.class);
// 
// 	public static void reset() {
// 		Mockito.reset(instance);
// 	}
// 
// 	public boolean isInMatchingCloud() {
// 		return instance.isInMatchingCloud();
// 	}
// 
// 	public ApplicationInstanceInfo getApplicationInstanceInfo() {
// 		return instance.getApplicationInstanceInfo();
// 	}
// 
// 	public List<ServiceInfo> getServiceInfos() {
// 		return instance.getServiceInfos();
// 	}
// }
// 
// Path: spring-cloud-services-connector-core/src/main/java/io/pivotal/spring/cloud/service/common/ConfigServerServiceInfo.java
// public class ConfigServerServiceInfo extends UriBasedServiceInfo {
// 	private String clientId;
// 	private String clientSecret;
// 	private String accessTokenUri;
// 
// 	public ConfigServerServiceInfo(String id, String uriString, String clientId, String clientSecret, String accessTokenUri) {
// 		super(id, uriString);
// 		this.clientId = clientId;
// 		this.clientSecret = clientSecret;
// 		this.accessTokenUri = accessTokenUri;
// 	}
// 
// 	public String getClientId() {
// 		return clientId;
// 	}
// 
// 	public String getClientSecret() {
// 		return clientSecret;
// 	}
// 
// 	public String getAccessTokenUri() {
// 		return accessTokenUri;
// 	}
// }
// 
// Path: spring-cloud-services-spring-connector/src/main/java/io/pivotal/spring/cloud/config/java/ServiceInfoPropertySourceAdapter.java
// public static final String SPRING_AUTOCONFIGURE_EXCLUDE = "spring.autoconfigure.exclude";
// 
// Path: spring-cloud-services-spring-connector/src/main/java/io/pivotal/spring/cloud/service/config/ConfigServerServiceConnector.java
// public static final String SPRING_CLOUD_CONFIG_OAUTH2_CLIENT_ACCESS_TOKEN_URI = "spring.cloud.config.client.oauth2.accessTokenUri";
// 
// Path: spring-cloud-services-spring-connector/src/main/java/io/pivotal/spring/cloud/service/config/ConfigServerServiceConnector.java
// public static final String SPRING_CLOUD_CONFIG_OAUTH2_CLIENT_CLIENT_ID = "spring.cloud.config.client.oauth2.clientId";
// 
// Path: spring-cloud-services-spring-connector/src/main/java/io/pivotal/spring/cloud/service/config/ConfigServerServiceConnector.java
// public static final String SPRING_CLOUD_CONFIG_OAUTH2_CLIENT_CLIENT_SECRET = "spring.cloud.config.client.oauth2.clientSecret";
// 
// Path: spring-cloud-services-spring-connector/src/main/java/io/pivotal/spring/cloud/service/config/ConfigServerServiceConnector.java
// public static final String SPRING_CLOUD_CONFIG_URI = "spring.cloud.config.uri";


import java.util.Collections;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import io.pivotal.spring.cloud.MockCloudConnector;
import io.pivotal.spring.cloud.service.common.ConfigServerServiceInfo;
import static io.pivotal.spring.cloud.config.java.ServiceInfoPropertySourceAdapter.SPRING_AUTOCONFIGURE_EXCLUDE;
import static io.pivotal.spring.cloud.service.config.ConfigServerServiceConnector.SPRING_CLOUD_CONFIG_OAUTH2_CLIENT_ACCESS_TOKEN_URI;
import static io.pivotal.spring.cloud.service.config.ConfigServerServiceConnector.SPRING_CLOUD_CONFIG_OAUTH2_CLIENT_CLIENT_ID;
import static io.pivotal.spring.cloud.service.config.ConfigServerServiceConnector.SPRING_CLOUD_CONFIG_OAUTH2_CLIENT_CLIENT_SECRET;
import static io.pivotal.spring.cloud.service.config.ConfigServerServiceConnector.SPRING_CLOUD_CONFIG_URI;
import static org.junit.Assert.assertEquals;

		@Test
		public void springAutoConfigureExcludeIsNull() {
			assertPropertyEquals(null, SPRING_AUTOCONFIGURE_EXCLUDE);
		}

	}

	public static class WithoutRabbitBinding extends ConfigServerServiceConnectorIntegrationTest {

		@Test
		public void springAutoConfigureExcludeIsOnlyRabbitAutoConfig() {
			assertPropertyEquals("org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration",
					SPRING_AUTOCONFIGURE_EXCLUDE);
		}

	}

	@TestPropertySource(properties = "spring.autoconfigure.exclude=com.foo.Bar")
	public static class WithoutRabbitBindingButWithExistingAutoConfigExcludes extends ConfigServerServiceConnectorIntegrationTest {

		@Test
		public void springAutoConfigureExcludePreservesExistingExcludes() {
			assertPropertyEquals("org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration,com.foo.Bar", SPRING_AUTOCONFIGURE_EXCLUDE);
		}

	}

	@Test
	public void propertySourceIsAdded() {
// Path: spring-cloud-services-spring-connector/src/test/java/io/pivotal/spring/cloud/MockCloudConnector.java
// public class MockCloudConnector implements CloudConnector {
// 
// 	public static final CloudConnector instance = Mockito.mock(CloudConnector.class);
// 
// 	public static void reset() {
// 		Mockito.reset(instance);
// 	}
// 
// 	public boolean isInMatchingCloud() {
// 		return instance.isInMatchingCloud();
// 	}
// 
// 	public ApplicationInstanceInfo getApplicationInstanceInfo() {
// 		return instance.getApplicationInstanceInfo();
// 	}
// 
// 	public List<ServiceInfo> getServiceInfos() {
// 		return instance.getServiceInfos();
// 	}
// }
// 
// Path: spring-cloud-services-connector-core/src/main/java/io/pivotal/spring/cloud/service/common/ConfigServerServiceInfo.java
// public class ConfigServerServiceInfo extends UriBasedServiceInfo {
// 	private String clientId;
// 	private String clientSecret;
// 	private String accessTokenUri;
// 
// 	public ConfigServerServiceInfo(String id, String uriString, String clientId, String clientSecret, String accessTokenUri) {
// 		super(id, uriString);
// 		this.clientId = clientId;
// 		this.clientSecret = clientSecret;
// 		this.accessTokenUri = accessTokenUri;
// 	}
// 
// 	public String getClientId() {
// 		return clientId;
// 	}
// 
// 	public String getClientSecret() {
// 		return clientSecret;
// 	}
// 
// 	public String getAccessTokenUri() {
// 		return accessTokenUri;
// 	}
// }
// 
// Path: spring-cloud-services-spring-connector/src/main/java/io/pivotal/spring/cloud/config/java/ServiceInfoPropertySourceAdapter.java
// public static final String SPRING_AUTOCONFIGURE_EXCLUDE = "spring.autoconfigure.exclude";
// 
// Path: spring-cloud-services-spring-connector/src/main/java/io/pivotal/spring/cloud/service/config/ConfigServerServiceConnector.java
// public static final String SPRING_CLOUD_CONFIG_OAUTH2_CLIENT_ACCESS_TOKEN_URI = "spring.cloud.config.client.oauth2.accessTokenUri";
// 
// Path: spring-cloud-services-spring-connector/src/main/java/io/pivotal/spring/cloud/service/config/ConfigServerServiceConnector.java
// public static final String SPRING_CLOUD_CONFIG_OAUTH2_CLIENT_CLIENT_ID = "spring.cloud.config.client.oauth2.clientId";
// 
// Path: spring-cloud-services-spring-connector/src/main/java/io/pivotal/spring/cloud/service/config/ConfigServerServiceConnector.java
// public static final String SPRING_CLOUD_CONFIG_OAUTH2_CLIENT_CLIENT_SECRET = "spring.cloud.config.client.oauth2.clientSecret";
// 
// Path: spring-cloud-services-spring-connector/src/main/java/io/pivotal/spring/cloud/service/config/ConfigServerServiceConnector.java
// public static final String SPRING_CLOUD_CONFIG_URI = "spring.cloud.config.uri";


// Path: spring-cloud-services-spring-connector/src/test/java/io/pivotal/spring/cloud/service/config/ConfigServerServiceConnectorIntegrationTest.java
import java.util.Collections;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import io.pivotal.spring.cloud.MockCloudConnector;
import io.pivotal.spring.cloud.service.common.ConfigServerServiceInfo;
import static io.pivotal.spring.cloud.config.java.ServiceInfoPropertySourceAdapter.SPRING_AUTOCONFIGURE_EXCLUDE;
import static io.pivotal.spring.cloud.service.config.ConfigServerServiceConnector.SPRING_CLOUD_CONFIG_OAUTH2_CLIENT_ACCESS_TOKEN_URI;
import static io.pivotal.spring.cloud.service.config.ConfigServerServiceConnector.SPRING_CLOUD_CONFIG_OAUTH2_CLIENT_CLIENT_ID;
import static io.pivotal.spring.cloud.service.config.ConfigServerServiceConnector.SPRING_CLOUD_CONFIG_OAUTH2_CLIENT_CLIENT_SECRET;
import static io.pivotal.spring.cloud.service.config.ConfigServerServiceConnector.SPRING_CLOUD_CONFIG_URI;
import static org.junit.Assert.assertEquals;


		@Test
		public void springAutoConfigureExcludeIsNull() {
			assertPropertyEquals(null, SPRING_AUTOCONFIGURE_EXCLUDE);
		}

	}

	public static class WithoutRabbitBinding extends ConfigServerServiceConnectorIntegrationTest {

		@Test
		public void springAutoConfigureExcludeIsOnlyRabbitAutoConfig() {
			assertPropertyEquals("org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration",
					SPRING_AUTOCONFIGURE_EXCLUDE);
		}

	}

	@TestPropertySource(properties = "spring.autoconfigure.exclude=com.foo.Bar")
	public static class WithoutRabbitBindingButWithExistingAutoConfigExcludes extends ConfigServerServiceConnectorIntegrationTest {

		@Test
		public void springAutoConfigureExcludePreservesExistingExcludes() {
			assertPropertyEquals("org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration,com.foo.Bar", SPRING_AUTOCONFIGURE_EXCLUDE);
		}

	}

	@Test
	public void propertySourceIsAdded() {
		assertPropertyEquals(URI, SPRING_CLOUD_CONFIG_URI);