CamelConfigurableBindingServiceProperties extends BindingServiceProperties { public void setCamelConfiguration( SpringCloudStreamEndpointConfiguration camelConfiguration, String bindingName) { this.camelConfiguration = camelConfiguration; copyNonNullProperties(camelConfiguration, this); BindingProperties bindingProperties = mergeBindingProperties(bindingName); mergeAndAddConsumerProperties(bindingName, bindingProperties); mergeAndAddProducerProperties(bindingName, bindingProperties); } CamelConfigurableBindingServiceProperties(
			BindingServiceProperties bindingServiceProperties); @Override ConsumerProperties getConsumerProperties(String inputBindingName); @Override ProducerProperties getProducerProperties(String outputBindingName); void setCamelConfiguration(
			SpringCloudStreamEndpointConfiguration camelConfiguration,
			String bindingName);  }
@Test public void testHonourBindingPropertiesDefaultBehaviour() { BindingServiceProperties BindingServiceProperties = new BindingServiceProperties(); BindingServiceProperties.setInstanceCount(2); BindingServiceProperties.setInstanceIndex(1); CamelConfigurableBindingServiceProperties properties = new CamelConfigurableBindingServiceProperties( BindingServiceProperties); properties.setCamelConfiguration(new SpringCloudStreamEndpointConfiguration(), "input"); assertThat(properties.getInstanceCount()).isEqualTo(2); assertThat(properties.getInstanceIndex()).isEqualTo(1); }
@Test public void testBindingPropertiesOverriddenByCamelConfiguration() { BindingServiceProperties BindingServiceProperties = new BindingServiceProperties(); BindingServiceProperties.setInstanceCount(2); BindingServiceProperties.setInstanceIndex(1); BindingServiceProperties.setDefaultBinder("default"); CamelConfigurableBindingServiceProperties properties = new CamelConfigurableBindingServiceProperties( BindingServiceProperties); SpringCloudStreamEndpointConfiguration camelConfiguration = new SpringCloudStreamEndpointConfiguration(); camelConfiguration.setInstanceCount(1); camelConfiguration.setInstanceIndex(0); properties.setCamelConfiguration(camelConfiguration, "input"); assertThat(properties.getInstanceCount()).isEqualTo(1); assertThat(properties.getInstanceIndex()).isEqualTo(0); assertThat(properties.getDefaultBinder()).isEqualTo("default"); }