Minor fixes: formatting, cleanup

This commit is contained in:
Marius Bogoevici
2016-04-06 11:29:38 -04:00
parent 277d896e1d
commit 0b4b916fe6
4 changed files with 13 additions and 24 deletions

View File

@@ -16,16 +16,12 @@
package org.springframework.cloud.stream.config;
import static org.hamcrest.Matchers.instanceOf;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.SpringApplicationConfiguration;
@@ -42,6 +38,8 @@ import org.springframework.tuple.Tuple;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* @author Ilayaperumal Gopinathan
@@ -76,7 +74,6 @@ public class MessageChannelConfigurerTests {
@Test
public void testObjectMapperConfig() {
assertNotNull( "ObjectMapper should exist", objectMapper);
assertTrue("SerializationFeature 'WRITE_DATES_AS_TIMESTAMPS' should be disabled", !objectMapper.getSerializationConfig().isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS));
}

View File

@@ -1,3 +1,3 @@
spring.cloud.stream.bindings.input.destination=configure1
spring.cloud.stream.bindings.input.contentType=application/x-spring-tuple
spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS:false
spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false

View File

@@ -99,16 +99,16 @@ public class ChannelBindingServiceConfiguration {
// it is used to detect a ChannelBindingService in the parent context (which we know
// already exists).
@ConditionalOnMissingBean(ChannelBindingService.class)
public ChannelBindingService bindingService(
ChannelBindingServiceProperties channelBindingServiceProperties,
public ChannelBindingService bindingService(ChannelBindingServiceProperties channelBindingServiceProperties,
BinderFactory<MessageChannel> binderFactory) {
return new ChannelBindingService(channelBindingServiceProperties, binderFactory);
}
@Bean
public MessageConverterConfigurer messageConverterConfigurer(ChannelBindingServiceProperties channelBindingServiceProperties,
MessageBuilderFactory messageBuilderFactory,
CompositeMessageConverterFactory compositeMessageConverterFactory) {
public MessageConverterConfigurer messageConverterConfigurer(
ChannelBindingServiceProperties channelBindingServiceProperties,
MessageBuilderFactory messageBuilderFactory,
CompositeMessageConverterFactory compositeMessageConverterFactory) {
return new MessageConverterConfigurer(channelBindingServiceProperties, messageBuilderFactory, compositeMessageConverterFactory);
}
@@ -235,7 +235,8 @@ public class ChannelBindingServiceConfiguration {
}
@Bean
public static StreamListenerAnnotationBeanPostProcessor bindToAnnotationBeanPostProcessor(@Lazy BinderAwareChannelResolver binderAwareChannelResolver,
public static StreamListenerAnnotationBeanPostProcessor bindToAnnotationBeanPostProcessor(
@Lazy BinderAwareChannelResolver binderAwareChannelResolver,
@Lazy CompositeMessageConverterFactory compositeMessageConverterFactory) {
DefaultMessageHandlerMethodFactory messageHandlerMethodFactory = new DefaultMessageHandlerMethodFactory();
messageHandlerMethodFactory.setMessageConverter(compositeMessageConverterFactory.getMessageConverterForAllRegistered());

View File

@@ -19,11 +19,7 @@ package org.springframework.cloud.stream.config;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -31,12 +27,14 @@ import org.springframework.boot.test.IntegrationTest;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.utils.MockBinderRegistryConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.expression.Expression;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Tests for SpelExpressionConverterConfiguration.
*
@@ -76,13 +74,6 @@ public class SpelExpressionConverterConfigurationTests {
@EnableConfigurationProperties(Pojo.class)
public static class Config {
/**
* Installs some PAs on the EvaluationContext.
*/
@Bean
public static BeanPostProcessor propertyAccessorConfigurer() {
return ChannelBindingServiceConfiguration.PostProcessorConfiguration.propertyAccessorBeanPostProcessor();
}
}
}