package org.springframework.cloud.contract.stubrunner.messaging;

import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration;
import org.springframework.cloud.stream.test.binder.MessageCollectorAutoConfiguration;
import org.springframework.cloud.stream.test.binder.TestSupportBinderAutoConfiguration;
import org.springframework.context.annotation.Configuration;

/**
 * Supports
 * {@link org.springframework.cloud.contract.stubrunner.spring.AutoConfigureStubRunner} by
 * loading in AutoConfigurations related to Stream and Integration only if the relevant
 * jars are in classpath.
 *
 * @author Biju Kunjummen
 */
@Configuration
public class StubRunnerStreamsIntegrationAutoConfiguration {

	@Configuration
	@ConditionalOnClass(TestSupportBinderAutoConfiguration.class)
	@ImportAutoConfiguration(classes = { TestSupportBinderAutoConfiguration.class,
			MessageCollectorAutoConfiguration.class, IntegrationAutoConfiguration.class })
	static class StreamsRelatedAutoConfiguration {

	}

	@Configuration
	@ConditionalOnClass(IntegrationAutoConfiguration.class)
	@ImportAutoConfiguration(classes = { IntegrationAutoConfiguration.class })
	static class IntegrationRelatedAutoConfiguration {

	}

}

@@ -122,32 +122,107 @@
 oConfiguration;%0A
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;%0A
 import org.sprin
@@ -448,32 +448,103 @@
 oConfiguration;%0A
+import org.springframework.cloud.stream.test.binder.TestSupportBinder;%0A
 import org.sprin
@@ -1079,32 +1079,77 @@
 guration.class)%0A
+%09@ConditionalOnBean(TestSupportBinder.class)%0A
 %09@ImportAutoConf

fix stub runner application when is in real stream mode (#805)