From 0b4b916fe68ec15c71641481254089f1a3309af5 Mon Sep 17 00:00:00 2001 From: Marius Bogoevici Date: Wed, 6 Apr 2016 11:29:38 -0400 Subject: [PATCH] Minor fixes: formatting, cleanup --- .../config/MessageChannelConfigurerTests.java | 7 ++----- .../channel/sink-channel-configurers.properties | 2 +- .../ChannelBindingServiceConfiguration.java | 13 +++++++------ ...SpelExpressionConverterConfigurationTests.java | 15 +++------------ 4 files changed, 13 insertions(+), 24 deletions(-) diff --git a/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/config/MessageChannelConfigurerTests.java b/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/config/MessageChannelConfigurerTests.java index dc4cbb69a..a3fbb59d8 100644 --- a/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/config/MessageChannelConfigurerTests.java +++ b/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/config/MessageChannelConfigurerTests.java @@ -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)); } diff --git a/spring-cloud-stream-integration-tests/src/test/resources/org/springframework/cloud/stream/config/channel/sink-channel-configurers.properties b/spring-cloud-stream-integration-tests/src/test/resources/org/springframework/cloud/stream/config/channel/sink-channel-configurers.properties index f6c849725..9a5e464a4 100644 --- a/spring-cloud-stream-integration-tests/src/test/resources/org/springframework/cloud/stream/config/channel/sink-channel-configurers.properties +++ b/spring-cloud-stream-integration-tests/src/test/resources/org/springframework/cloud/stream/config/channel/sink-channel-configurers.properties @@ -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 diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingServiceConfiguration.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingServiceConfiguration.java index af78b3f7c..abf02e513 100644 --- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingServiceConfiguration.java +++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingServiceConfiguration.java @@ -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 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()); diff --git a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/config/SpelExpressionConverterConfigurationTests.java b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/config/SpelExpressionConverterConfigurationTests.java index 17cf5b20f..5338528e4 100644 --- a/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/config/SpelExpressionConverterConfigurationTests.java +++ b/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/config/SpelExpressionConverterConfigurationTests.java @@ -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(); - } } }