* Simplify functionalTracingEnabled variable logic

* Add `BeanFactoryAwareFunctionRegistryTests.testWrappedWithAroundAdviseNotMessageReturnConfiguration()`
to verify that non-Message return from the target function is wrapped to the `Message` before return
to the `FunctionAroundWrapper`
This commit is contained in:
Artem Bilan
2022-02-02 14:16:16 -05:00
committed by Oleg Zhurakousky
parent 80305e630b
commit 49e027a0ee
2 changed files with 38 additions and 3 deletions

View File

@@ -38,9 +38,8 @@ public abstract class FunctionAroundWrapper implements BiFunction<Object, Functi
@Override
public final Object apply(Object input, FunctionInvocationWrapper targetFunction) {
String functionalTracingEnabledStr = System.getProperty("spring.sleuth.function.enabled");
boolean functionalTracingEnabled =
!StringUtils.hasText(functionalTracingEnabledStr) || Boolean.parseBoolean(functionalTracingEnabledStr);
String functionalTracingEnabledStr = System.getProperty("spring.sleuth.function.enabled", "true");
boolean functionalTracingEnabled = Boolean.parseBoolean(functionalTracingEnabledStr);
if (functionalTracingEnabled) {
return this.doApply(input, targetFunction);
}