Fix compatibility with the latest SF

This commit is contained in:
Artem Bilan
2020-08-26 12:43:47 -04:00
parent d95c7149c4
commit 52070259b3

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 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.
@@ -20,6 +20,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import java.io.ByteArrayInputStream;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -45,7 +46,6 @@ import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.PollableChannel;
import org.springframework.messaging.support.GenericMessage;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
/**
@@ -212,7 +212,7 @@ public class InnerDefinitionHandlerAwareEndpointParserTests {
bootStrap(configProperty);
EventDrivenConsumer splitter = this.applicationContext.getBean("testSplitter", EventDrivenConsumer.class);
assertThat(splitter).isNotNull();
MessageBuilder<String[]> inChannelMessageBuilder = MessageBuilder.withPayload(new String[] { "One", "Two" });
MessageBuilder<String[]> inChannelMessageBuilder = MessageBuilder.withPayload(new String[]{ "One", "Two" });
Message<String[]> inMessage = inChannelMessageBuilder.build();
MessageChannel inChannel = this.applicationContext.getBean("inChannel", MessageChannel.class);
inChannel.send(inMessage);
@@ -226,7 +226,7 @@ public class InnerDefinitionHandlerAwareEndpointParserTests {
bootStrap(configProperty);
EventDrivenConsumer transformer = this.applicationContext.getBean("testTransformer", EventDrivenConsumer.class);
assertThat(transformer).isNotNull();
MessageBuilder<String[]> inChannelMessageBuilder = MessageBuilder.withPayload(new String[] { "One", "Two" });
MessageBuilder<String[]> inChannelMessageBuilder = MessageBuilder.withPayload(new String[]{ "One", "Two" });
Message<String[]> inMessage = inChannelMessageBuilder.build();
DirectChannel inChannel = this.applicationContext.getBean("inChannel", DirectChannel.class);
inChannel.send(inMessage);
@@ -305,11 +305,10 @@ public class InnerDefinitionHandlerAwareEndpointParserTests {
return headers;
}
@SuppressWarnings("unchecked")
public static class TestSplitter {
public Collection<String> split(String[] payload) {
return CollectionUtils.arrayToList(payload);
return Arrays.asList(payload);
}
}