Revert "GH-816 Fix support for function that returns Iterable with target-protocol set"

This reverts commit ed6642e18e.
This commit is contained in:
Oleg Zhurakousky
2022-02-23 12:18:17 +01:00
parent ed6642e18e
commit 95f9fbf417
3 changed files with 2 additions and 22 deletions

View File

@@ -55,7 +55,6 @@ import org.springframework.cloud.function.context.FunctionCatalog;
import org.springframework.cloud.function.context.FunctionRegistration;
import org.springframework.cloud.function.context.FunctionRegistry;
import org.springframework.cloud.function.context.catalog.SimpleFunctionRegistry.FunctionInvocationWrapper;
import org.springframework.cloud.function.context.message.MessageUtils;
import org.springframework.cloud.function.json.JsonMapper;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
@@ -432,18 +431,6 @@ public class BeanFactoryAwareFunctionRegistryTests {
assertThat(result instanceof Message).isFalse();
}
@Test
public void testMultipleValuesInOutputHandlingWithTargetProtocol() throws Exception {
FunctionCatalog catalog = this.configureCatalog(CollectionOutConfiguration.class);
FunctionInvocationWrapper function = catalog.lookup("parseToList", "application/json");
assertThat(function).isNotNull();
Object result = function.apply(MessageBuilder.withPayload("1, 2, 3".getBytes())
.setHeader(MessageHeaders.CONTENT_TYPE, "text/plain")
.setHeader(MessageUtils.TARGET_PROTOCOL, "integration")
.build());
assertThat(result instanceof List).isTrue();
}
/**
* The following two tests test the fallback mechanism when an accept header has several values.
* The function produces Integer, which cannot be serialized by the default converter supporting text/plain