SimpleFunctionRegistry: Fixed: compose of supplier...consumer pipeline produces a supplier type. This fix allows testing of composed pipelines without input and output

SimpleFunctionRegistry: added info. No functional changes

Resolves #809
This commit is contained in:
Roman S Samarev
2022-02-13 14:38:14 +03:00
committed by Oleg Zhurakousky
parent 59d02ed652
commit 3fa021b4fa
2 changed files with 42 additions and 3 deletions

View File

@@ -80,6 +80,7 @@ import org.springframework.util.StringUtils;
* such as type conversion, composition, POJO etc.
*
* @author Oleg Zhurakousky
* @author Roman Samarev
*
*/
public class SimpleFunctionRegistry implements FunctionRegistry, FunctionInspector {
@@ -625,9 +626,9 @@ public class SimpleFunctionRegistry implements FunctionRegistry, FunctionInspect
Type composedFunctionType;
if (afterWrapper.outputType == null) {
composedFunctionType = ResolvableType.forClassWithGenerics(Consumer.class, this.inputType == null
? null
: ResolvableType.forType(this.inputType)).getType();
composedFunctionType = (this.inputType == null) ?
ResolvableType.forClassWithGenerics(Supplier.class, ResolvableType.forType(Object.class)).getType() :
ResolvableType.forClassWithGenerics(Consumer.class, ResolvableType.forType(this.inputType)).getType();
}
else if (this.inputType == null && afterWrapper.outputType != null) {
ResolvableType composedOutputType;