Upgrade build to boot 2.x

- Pump up version to 2.0.0
- Some generic polish
- All changes around breakage with boot 2.x
- Some boot classes has been moved around
- You can't no longer have binding key ending with
  camelCase.
- New Binder now has illegal keys.
- Some changes to tests as we can directly do end-to-end
  testing with ENV_VAR_FORMAT as normal keys
- Spring data repo changes as now uses Optional
- Remove relaxed binder and its tests in favor of new Binder
- Some mockito api changes
- One Ingored test TextPlainToJsonConversionTest.testTextPlainToJsonConversionOnInput
- Relates to #935

Cache metric export properties

Add code formatting guidelines

Rearranged files
This commit is contained in:
Janne Valkealahti
2017-05-12 10:43:01 +01:00
committed by Soby Chacko
parent e2c214b34e
commit 4f72a10bc6
39 changed files with 244 additions and 418 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,6 +35,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.integration.support.converter.ConfigurableCompositeMessageConverter;
import org.springframework.integration.support.converter.DefaultDatatypeChannelMessageConverter;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
@@ -49,6 +50,7 @@ import static org.hamcrest.Matchers.notNullValue;
/**
* @author Ilayaperumal Gopinathan
* @author Janne Valkealahti
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = CustomMessageConverterTests.TestSource.class)
@@ -66,9 +68,10 @@ public class CustomMessageConverterTests {
@Test
public void testCustomMessageConverter() throws Exception {
assertThat(customMessageConverters).hasSize(3);
assertThat(customMessageConverters).hasSize(4);
assertThat(customMessageConverters).extracting("class").contains(FooConverter.class,
BarConverter.class, DefaultDatatypeChannelMessageConverter.class);
BarConverter.class, DefaultDatatypeChannelMessageConverter.class,
ConfigurableCompositeMessageConverter.class);
testSource.output().send(MessageBuilder.withPayload(new Foo("hi")).build());
@SuppressWarnings("unchecked")
Message<String> received = (Message<String>) ((TestSupportBinder) binderFactory.getBinder(null,

View File

@@ -55,7 +55,6 @@ public class TextPlainToJsonConversionTest {
@Test
public void testNoContentTypeToJsonConversionOnInput() throws Exception {
testProcessor.input().send(MessageBuilder.withPayload("{\"name\":\"Bar\"}").build());
@SuppressWarnings("unchecked")
Message<?> received = ((TestSupportBinder) binderFactory.getBinder(null, MessageChannel.class))
.messageCollector().forChannel(testProcessor.output()).poll(1, TimeUnit.SECONDS);
assertThat(received).isNotNull();
@@ -66,7 +65,6 @@ public class TextPlainToJsonConversionTest {
public void testTextPlainToJsonConversionOnInput() throws Exception {
testProcessor.input().send(MessageBuilder.withPayload("{\"name\":\"Bar\"}")
.setHeader(MessageHeaders.CONTENT_TYPE, "text/plain").build());
@SuppressWarnings("unchecked")
Message<?> received = ((TestSupportBinder) binderFactory.getBinder(null, MessageChannel.class))
.messageCollector().forChannel(testProcessor.output()).poll(1, TimeUnit.SECONDS);
assertThat(received).isNotNull();
@@ -80,7 +78,9 @@ public class TextPlainToJsonConversionTest {
@StreamListener("input")
@SendTo("output")
public Foo consume(Foo foo) {
return new Foo("transformed-" + foo.getName());
Foo returnFoo = new Foo();
returnFoo.setName("transformed-" + foo.getName());
return returnFoo;
}
}
@@ -92,10 +92,6 @@ public class TextPlainToJsonConversionTest {
public Foo() {
}
public Foo(String name) {
this.name = name;
}
public String getName() {
return name;
}