Fix to-Message conversion logic

Fixed  logic to ensure that for cases where user may return a Message with no contentType set, the property-set content type is propagated
This commit is contained in:
Oleg Zhurakousky
2020-02-22 08:24:27 +01:00
parent 9eb98bd545
commit f4530e0d89
2 changed files with 22 additions and 15 deletions

View File

@@ -83,7 +83,10 @@ public class BeanFactoryAwareFunctionRegistryTests {
assertThat(((boolean) field.get(function))).isFalse();
//==
System.setProperty("spring.cloud.function.definition", "uppercase|uppercaseFlux");
function = catalog.lookup("");
function = catalog.lookup("", "application/json");
Function<Flux<String>, Flux<Message<String>>> typedFunction = (Function<Flux<String>, Flux<Message<String>>>) function;
Object blockFirst = typedFunction.apply(Flux.just("hello")).blockFirst();
System.out.println(blockFirst);
assertThat(function).isNotNull();
field = ReflectionUtils.findField(FunctionInvocationWrapper.class, "composed");
field.setAccessible(true);